Bug 796938 - Switch nsGlobalWindow::SecurityCheckURL to GetEntryGlobal. r=smaug
authorBobby Holley <bobbyholley@gmail.com>
Tue, 19 Aug 2014 12:02:06 -0700
changeset 214756 8cff1cd635f9b96c835cf8847564414fb3395513
parent 214755 768cb6193db5a31a86e72e52dc9977bc5ad380ff
child 214757 6fda5f5e9a47d0b60d699e9749eaa77ad3e65dea
push idunknown
push userunknown
push dateunknown
reviewerssmaug
bugs796938
milestone34.0a1
Bug 796938 - Switch nsGlobalWindow::SecurityCheckURL to GetEntryGlobal. r=smaug
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -12799,21 +12799,17 @@ nsGlobalWindow::GetScrollFrame()
     return presShell->GetRootScrollFrameAsScrollable();
   }
   return nullptr;
 }
 
 nsresult
 nsGlobalWindow::SecurityCheckURL(const char *aURL)
 {
-  nsCOMPtr<nsPIDOMWindow> sourceWindow;
-  JSContext* topCx = nsContentUtils::GetCurrentJSContext();
-  if (topCx) {
-    sourceWindow = do_QueryInterface(nsJSUtils::GetDynamicScriptGlobal(topCx));
-  }
+  nsCOMPtr<nsPIDOMWindow> sourceWindow = do_QueryInterface(GetEntryGlobal());
   if (!sourceWindow) {
     sourceWindow = this;
   }
   AutoJSContext cx;
   nsGlobalWindow* sourceWin = static_cast<nsGlobalWindow*>(sourceWindow.get());
   JSAutoCompartment ac(cx, sourceWin->GetGlobalJSObject());
 
   // Resolve the baseURI, which could be relative to the calling window.