Bug 1505931 - Channel-Classifier should not skip annotation when TP is enabled, r=francois
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 01 Dec 2018 13:04:20 +0100
changeset 449061 f94594ae2fc11fb937adcb27b098b5f19b773fd1
parent 449060 ad63f8b4f0cd9d460dd6368d19fc78f776f3b65b
child 449062 fe5c160d056e25d10c63e2c9200e2a9e0a3db596
push id110299
push useramarchesini@mozilla.com
push dateSat, 01 Dec 2018 12:04:44 +0000
treeherdermozilla-inbound@c466f72acdec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrancois
bugs1505931
milestone65.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 1505931 - Channel-Classifier should not skip annotation when TP is enabled, r=francois
netwerk/base/nsChannelClassifier.cpp
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -432,33 +432,16 @@ bool nsChannelClassifier::ShouldEnableTr
   }
 
   mTrackingAnnotationEnabled = Some(false);
 
   if (!CachedPrefs::GetInstance()->IsAnnotateChannelEnabled()) {
     return mTrackingAnnotationEnabled.value();
   }
 
-  // If tracking protection is enabled, no need to do channel annotation.
-  if (ShouldEnableTrackingProtection()) {
-    return mTrackingAnnotationEnabled.value();
-  }
-
-  // To prevent calling ShouldEnableTrackingProtectionInternal() again,
-  // check loadContext->UseTrackingProtection() here.
-  // If loadContext->UseTrackingProtection() is true, here it means
-  // ShouldEnableTrackingProtectionInternal() has been called before in
-  // ShouldEnableTrackingProtection() above and the result is false.
-  // So, we can just return false.
-  nsCOMPtr<nsILoadContext> loadContext;
-  NS_QueryNotificationCallbacks(mChannel, loadContext);
-  if (loadContext && loadContext->UseTrackingProtection()) {
-    return mTrackingAnnotationEnabled.value();
-  }
-
   Unused << ShouldEnableTrackingProtectionInternal(
       mChannel, true, mTrackingAnnotationEnabled.ptr());
 
   return mTrackingAnnotationEnabled.value();
 }
 
 nsresult nsChannelClassifier::ShouldEnableTrackingProtectionInternal(
     nsIChannel* aChannel, bool aAnnotationsOnly, bool* result) {