Bug 1535697 - Part 3: Only consider third-party tracking resources as isolated channels; r=michal
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 29 Apr 2019 17:09:39 +0000
changeset 471770 c79109688f298afc5db560301132b5cfd7f5a56e
parent 471769 6b122a9ce1a47a7a4084ca0bd4f3d003a6360b11
child 471771 c22a48c48548ae60e13c61b81bbe7c1f408afade
push id35934
push usershindli@mozilla.com
push dateMon, 29 Apr 2019 21:53:38 +0000
treeherdermozilla-central@f6766ba4ac77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1535697
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535697 - Part 3: Only consider third-party tracking resources as isolated channels; r=michal Differential Revision: https://phabricator.services.mozilla.com/D28373
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3893,18 +3893,19 @@ nsresult nsHttpChannel::OpenCacheEntry(b
 
   return OpenCacheEntryInternal(isHttps, mApplicationCache, true);
 }
 
 bool nsHttpChannel::IsIsolated() {
   if (mHasBeenIsolatedChecked) {
     return mIsIsolated;
   }
-  mIsIsolated = !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-      this, mURI, nullptr);
+  mIsIsolated = IsThirdPartyTrackingResource() &&
+                !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
+                    this, mURI, nullptr);
   mHasBeenIsolatedChecked = true;
   return mIsIsolated;
 }
 
 nsresult nsHttpChannel::OpenCacheEntryInternal(
     bool isHttps, nsIApplicationCache *applicationCache,
     bool allowApplicationCache) {
   MOZ_ASSERT_IF(!allowApplicationCache, !applicationCache);
@@ -4018,17 +4019,17 @@ nsresult nsHttpChannel::OpenCacheEntryIn
 
   if (mPostID) {
     extension.Append(nsPrintfCString("%d", mPostID));
   }
   if (mTRR) {
     extension.Append("TRR");
   }
 
-  if (IsThirdPartyTrackingResource() && IsIsolated()) {
+  if (IsIsolated()) {
     nsCOMPtr<nsIURI> topWindowURI;
     rv = GetTopWindowURI(getter_AddRefs(topWindowURI));
     bool isDocument = false;
     if (NS_FAILED(rv) && NS_SUCCEEDED(GetIsMainDocumentChannel(&isDocument)) &&
         isDocument) {
       // For top-level documents, use the document channel's origin to compute
       // the unique storage space identifier instead of the top Window URI.
       rv = NS_GetFinalChannelURI(this, getter_AddRefs(topWindowURI));