Bug 988383 - Part 6: Replace AutoPushJSContext in nsGlobalWindow::GetMessageManager. r=bholley

This commit is contained in:
Bob Owen 2014-03-28 14:38:13 +00:00
parent 9aac2a4c5d
commit df004f7792

View File

@ -13398,15 +13398,11 @@ nsGlobalWindow::GetMessageManager(ErrorResult& aError)
nsGlobalChromeWindow* myself = static_cast<nsGlobalChromeWindow*>(this); nsGlobalChromeWindow* myself = static_cast<nsGlobalChromeWindow*>(this);
if (!myself->mMessageManager) { if (!myself->mMessageManager) {
nsIScriptContext* scx = GetContextInternal(); 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); aError.Throw(NS_ERROR_UNEXPECTED);
return nullptr; return nullptr;
} }
nsCOMPtr<nsIMessageBroadcaster> globalMM = nsCOMPtr<nsIMessageBroadcaster> globalMM =
do_GetService("@mozilla.org/globalmessagemanager;1"); do_GetService("@mozilla.org/globalmessagemanager;1");
myself->mMessageManager = myself->mMessageManager =