[tor-commits] [tor-browser/tor-browser-38.3.0esr-5.5-1] fixup! Bug #5742: API allows you to get the url bar URI for a channel or nsIDocument.
mikeperry at torproject.org
mikeperry at torproject.org
Thu Sep 17 21:12:32 UTC 2015
commit baca89fcad30603ccac4a2fe1f51ab3f0d0b8518
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date: Thu Sep 17 12:46:45 2015 -0700
fixup! Bug #5742: API allows you to get the url bar URI for a channel or nsIDocument.
---
dom/base/ThirdPartyUtil.cpp | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/dom/base/ThirdPartyUtil.cpp b/dom/base/ThirdPartyUtil.cpp
index e8ec06c..6f0a358 100644
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -648,13 +648,17 @@ ThirdPartyUtil::GetFirstPartyURIInternal(nsIChannel *aChannel,
if (aDoc->GetWindow()) {
aDoc->GetWindow()->GetTop(getter_AddRefs(top));
- top->GetDocument(getter_AddRefs(topDDoc));
-
- nsCOMPtr<nsIDocument> topDoc(do_QueryInterface(topDDoc));
- docURI = topDoc->GetOriginalURI();
- if (docURI) {
- // Give us a mutable URI and also addref
- rv = NS_EnsureSafeToReturn(docURI, aOutput);
+ if (top) {
+ top->GetDocument(getter_AddRefs(topDDoc));
+
+ nsCOMPtr<nsIDocument> topDoc(do_QueryInterface(topDDoc));
+ if (topDoc) {
+ docURI = topDoc->GetOriginalURI();
+ if (docURI) {
+ // Give us a mutable URI and also addref
+ rv = NS_EnsureSafeToReturn(docURI, aOutput);
+ }
+ }
}
} else {
// XXX: Chrome callers (such as NoScript) can end up here
More information about the tor-commits
mailing list