Bug 988383 - Part 6: Replace AutoPushJSContext in nsGlobalWindow::GetMessageManager. r=bholley
authorBob Owen <bobowencode@gmail.com>
Fri, 28 Mar 2014 14:38:13 +0000
changeset 198959 d75969295963ccb61d4272ed9a309fd967f7de99
parent 198958 d0e6a58352cdfc6eed4690d0f78ab5e60b6e242b
child 198960 994095bfc2e8ef759ef6ae63e82f216ea02f3a44
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs988383
milestone31.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 988383 - Part 6: Replace AutoPushJSContext in nsGlobalWindow::GetMessageManager. r=bholley
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -13393,25 +13393,21 @@ nsGlobalChromeWindow::GetMessageManager(
 nsIMessageBroadcaster*
 nsGlobalWindow::GetMessageManager(ErrorResult& aError)
 {
   FORWARD_TO_INNER_OR_THROW(GetMessageManager, (aError), aError, nullptr);
   MOZ_ASSERT(IsChromeWindow());
   nsGlobalChromeWindow* myself = static_cast<nsGlobalChromeWindow*>(this);
   if (!myself->mMessageManager) {
     nsIScriptContext* scx = GetContextInternal();
-    if (NS_WARN_IF(!scx)) {
+    if (NS_WARN_IF(!scx || !(scx->GetNativeContext()))) {
       aError.Throw(NS_ERROR_UNEXPECTED);
       return nullptr;
     }
-    AutoPushJSContext cx(scx->GetNativeContext());
-    if (NS_WARN_IF(!cx)) {
-      aError.Throw(NS_ERROR_UNEXPECTED);
-      return nullptr;
-    }
+
     nsCOMPtr<nsIMessageBroadcaster> globalMM =
       do_GetService("@mozilla.org/globalmessagemanager;1");
     myself->mMessageManager =
       new nsFrameMessageManager(nullptr,
                                 static_cast<nsFrameMessageManager*>(globalMM.get()),
                                 MM_CHROME | MM_BROADCASTER);
   }
   return myself->mMessageManager;