[tor-commits] [tor-browser/tor-browser-52.1.0esr-7.0-2] Bug 1329521 - GetLoadContextInfo() should not compare originAttributes and privateBrowsing boolean when docShell is chrome type, r=smaug

gk at torproject.org gk at torproject.org
Fri Jun 2 07:15:57 UTC 2017


commit 3f5f0f7d0b7a3384f5b46d2abef6b1bbf631077e
Author: Andrea Marchesini <amarchesini at mozilla.com>
Date:   Fri Jan 13 15:41:28 2017 +0100

    Bug 1329521 - GetLoadContextInfo() should not compare originAttributes and privateBrowsing boolean when docShell is chrome type, r=smaug
    
    Backported to ESR52: https://bugs.torproject.org/22462
---
 netwerk/base/LoadContextInfo.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/netwerk/base/LoadContextInfo.cpp b/netwerk/base/LoadContextInfo.cpp
index 61b9394..77eeb79 100644
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -5,6 +5,7 @@
 #include "LoadContextInfo.h"
 
 #include "mozilla/dom/ToJSValue.h"
+#include "nsDocShell.h"
 #include "nsIChannel.h"
 #include "nsILoadContext.h"
 #include "nsIWebNavigation.h"
@@ -141,14 +142,19 @@ GetLoadContextInfo(nsILoadContext *aLoadContext, bool aIsAnonymous)
                                NeckoOriginAttributes(nsILoadContextInfo::NO_APP_ID, false));
   }
 
-  DebugOnly<bool> pb = aLoadContext->UsePrivateBrowsing();
   DocShellOriginAttributes doa;
   aLoadContext->GetOriginAttributes(doa);
-  MOZ_ASSERT(pb == (doa.mPrivateBrowsingId > 0));
 
   NeckoOriginAttributes noa;
   noa.InheritFromDocShellToNecko(doa);
 
+#ifdef DEBUG
+  nsCOMPtr<nsIDocShellTreeItem> docShell = do_QueryInterface(aLoadContext);
+  if (!docShell || docShell->ItemType() != nsIDocShellTreeItem::typeChrome) {
+    MOZ_ASSERT(aLoadContext->UsePrivateBrowsing() == (doa.mPrivateBrowsingId > 0));
+  }
+#endif
+
   return new LoadContextInfo(aIsAnonymous, noa);
 }
 



More information about the tor-commits mailing list