Bug 1105556 - We won't have a channelLoadingPrincipal for top level loads, so nsChannelClassifier::SameLoadingURI will return false. Adding a comment to indicate that the behavior is fine since Tracking Protection doesn't apply to top level loads. r=fmarier
authorTanvi Vyas <tanvi@mozilla.com>
Wed, 13 Apr 2016 16:30:25 -0700
changeset 330998 2c073cc550110ad65707497398b8428036bfc39c
parent 330997 798ade8d33944ca07b50ef421a75a9e0145b69f1
child 330999 9ae70caf56c04ce2ee4d6d2494b819045781562d
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfmarier
bugs1105556
milestone48.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 1105556 - We won't have a channelLoadingPrincipal for top level loads, so nsChannelClassifier::SameLoadingURI will return false. Adding a comment to indicate that the behavior is fine since Tracking Protection doesn't apply to top level loads. r=fmarier
netwerk/base/nsChannelClassifier.cpp
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -494,18 +494,22 @@ nsChannelClassifier::HasBeenClassified(n
 bool
 nsChannelClassifier::SameLoadingURI(nsIDocument *aDoc, nsIChannel *aChannel)
 {
   nsCOMPtr<nsIURI> docURI = aDoc->GetDocumentURI();
   nsCOMPtr<nsILoadInfo> channelLoadInfo = aChannel->GetLoadInfo();
   if (!channelLoadInfo || !docURI) {
     return false;
   }
+
   nsCOMPtr<nsIPrincipal> channelLoadingPrincipal = channelLoadInfo->LoadingPrincipal();
   if (!channelLoadingPrincipal) {
+    // TYPE_DOCUMENT loads will not have a channelLoadingPrincipal. But top level
+    // loads should not be blocked by Tracking Protection, so we will return
+    // false
     return false;
   }
   nsCOMPtr<nsIURI> channelLoadingURI;
   channelLoadingPrincipal->GetURI(getter_AddRefs(channelLoadingURI));
   if (!channelLoadingURI) {
     return false;
   }
   bool equals = false;