Bug 826471. Add JSAutoCompartment in nsWindowSH::NewResolve. r=bholley
authorAndrew McCreight <amccreight@mozilla.com>
Thu, 17 Jan 2013 16:30:41 -0800
changeset 119217 c31858da7548de7e2b39dd1007447cf9c2cdbbd6
parent 119216 072531a694bfc261810d45b213435e5a3d9633b8
child 119218 b0c7f383f37424c64ba47d77bee1b3a786797f4d
push id24195
push userMs2ger@gmail.com
push dateSat, 19 Jan 2013 16:10:11 +0000
treeherdermozilla-central@02e12a80aef9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs826471
milestone21.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 826471. Add JSAutoCompartment in nsWindowSH::NewResolve. r=bholley
dom/base/nsDOMClassInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -6773,16 +6773,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
 
   if (s_content_id == id) {
     // Map window._content to window.content for backwards
     // compatibility, this should spit out an message on the JS
     // console.
 
     JSObject *windowObj = win->GetGlobalJSObject();
 
+    JSAutoCompartment ac(cx, windowObj);
     JSAutoRequest ar(cx);
 
     JSFunction *fun = ::JS_NewFunction(cx, ContentWindowGetter, 0, 0,
                                        windowObj, "_content");
     if (!fun) {
       return NS_ERROR_OUT_OF_MEMORY;
     }