Bug 871301 - Remove JS_GetGlobalObject from nsCrypto and nsDirectoryViewer. r=bz, a=lsblakk
☠☠ backed out by b3190912589e ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Tue, 14 May 2013 10:16:52 -0700
changeset 119789 e30fa70bd7815d03debc7c8d9066fb58db81557e
parent 119788 cf5aa5393dca70ce523d78babd911465c997b981
child 119790 ebd5ab3f3a02fbcee29d2f9fc85aa86064f454bf
push id994
push userryanvm@gmail.com
push dateTue, 23 Jul 2013 16:42:29 +0000
reviewersbz, lsblakk
bugs871301
milestone18.1
Bug 871301 - Remove JS_GetGlobalObject from nsCrypto and nsDirectoryViewer. r=bz, a=lsblakk
security/manager/ssl/src/nsCrypto.cpp
xpfe/components/directory/nsDirectoryViewer.cpp
--- a/security/manager/ssl/src/nsCrypto.cpp
+++ b/security/manager/ssl/src/nsCrypto.cpp
@@ -1925,17 +1925,17 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMF
     return NS_ERROR_FAILURE;
   }
   jsString = JS_ValueToString(cx, argv[4]);
   NS_ENSURE_TRUE(jsString, NS_ERROR_OUT_OF_MEMORY);
   argv[4] = STRING_TO_JSVAL(jsString);
   JSAutoByteString jsCallback(cx, jsString);
   NS_ENSURE_TRUE(!!jsCallback, NS_ERROR_OUT_OF_MEMORY);
 
-  nrv = xpc->WrapNative(cx, ::JS_GetGlobalObject(cx),
+  nrv = xpc->WrapNative(cx, JS_GetGlobalForScopeChain(cx),
                         static_cast<nsIDOMCrypto *>(this),
                         NS_GET_IID(nsIDOMCrypto), getter_AddRefs(holder));
   NS_ENSURE_SUCCESS(nrv, nrv);
 
   nrv = holder->GetJSObject(&script_obj);
   NS_ENSURE_SUCCESS(nrv, nrv);
 
   //Put up some UI warning that someone is trying to 
--- a/xpfe/components/directory/nsDirectoryViewer.cpp
+++ b/xpfe/components/directory/nsDirectoryViewer.cpp
@@ -154,17 +154,17 @@ nsHTTPIndex::OnFTPControlLog(bool server
     NS_ENSURE_TRUE(scriptGlobal, NS_OK);
 
     nsIScriptContext *context = scriptGlobal->GetContext();
     NS_ENSURE_TRUE(context, NS_OK);
 
     JSContext* cx = context->GetNativeContext();
     NS_ENSURE_TRUE(cx, NS_OK);
 
-    JSObject* global = JS_GetGlobalObject(cx);
+    JSObject* global = JS_GetGlobalForScopeChain(cx);
     NS_ENSURE_TRUE(global, NS_OK);
 
     jsval params[2];
 
     nsString unicodeMsg;
     unicodeMsg.AssignWithConversion(msg);
     JSAutoRequest ar(cx);
     JSString* jsMsgStr = JS_NewUCStringCopyZ(cx, (jschar*) unicodeMsg.get());
@@ -229,17 +229,17 @@ nsHTTPIndex::OnStartRequest(nsIRequest *
     // Now get the content viewer container's script object.
     nsCOMPtr<nsIScriptGlobalObject> scriptGlobal(do_GetInterface(mRequestor));
     NS_ENSURE_TRUE(scriptGlobal, NS_ERROR_FAILURE);
 
     nsIScriptContext *context = scriptGlobal->GetContext();
     NS_ENSURE_TRUE(context, NS_ERROR_FAILURE);
 
     JSContext* cx = context->GetNativeContext();
-    JSObject* global = JS_GetGlobalObject(cx);
+    JSObject* global = JS_GetGlobalForScopeChain(cx);
 
     // Using XPConnect, wrap the HTTP index object...
     static NS_DEFINE_CID(kXPConnectCID, NS_XPCONNECT_CID);
     nsCOMPtr<nsIXPConnect> xpc(do_GetService(kXPConnectCID, &rv));
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
     rv = xpc->WrapNative(cx,