Skip to content

Commit

Permalink
Bug 1735299 - We don't need to proxy release of URIs r=nhnt11
Browse files Browse the repository at this point in the history
Previously nsIURIs were not thread safe. Now they are, so releasing them on
any thread is fine.

Differential Revision: https://phabricator.services.mozilla.com/D128178
  • Loading branch information
valenting committed Oct 19, 2021
1 parent 0ebf029 commit 182d9a3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 0 additions & 6 deletions netwerk/protocol/http/ClassifierDummyChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ ClassifierDummyChannel::ClassifierDummyChannel(nsIURI* aURI,
SetLoadInfo(aLoadInfo);
}

ClassifierDummyChannel::~ClassifierDummyChannel() {
NS_ReleaseOnMainThread("ClassifierDummyChannel::mURI", mURI.forget());
NS_ReleaseOnMainThread("ClassifierDummyChannel::mTopWindowURI",
mTopWindowURI.forget());
}

void ClassifierDummyChannel::AddClassificationFlags(
uint32_t aClassificationFlags, bool aThirdParty) {
if (aThirdParty) {
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/http/ClassifierDummyChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ClassifierDummyChannel final : public nsIChannel,
void AddClassificationFlags(uint32_t aClassificationFlags, bool aThirdParty);

private:
~ClassifierDummyChannel();
~ClassifierDummyChannel() = default;

nsCOMPtr<nsILoadInfo> mLoadInfo;
nsCOMPtr<nsIURI> mURI;
Expand Down
4 changes: 1 addition & 3 deletions netwerk/url-classifier/AsyncUrlChannelClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class URIData {

private:
URIData();
~URIData();
~URIData() = default;

nsCOMPtr<nsIURI> mURI;
nsCString mURISpec;
Expand Down Expand Up @@ -117,8 +117,6 @@ nsresult URIData::Create(nsIURI* aURI, nsIURI* aInnermostURI,

URIData::URIData() { MOZ_ASSERT(NS_IsMainThread()); }

URIData::~URIData() { NS_ReleaseOnMainThread("URIData:mURI", mURI.forget()); }

bool URIData::IsEqual(nsIURI* aURI) const {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aURI);
Expand Down

0 comments on commit 182d9a3

Please sign in to comment.