Bug 826471 - Add JSAutoCompartment in nsWindowSH::NewResolve. r=bholley, a=akeybl
authorAndrew McCreight <amccreight@mozilla.com>
Thu, 17 Jan 2013 16:30:41 -0800
changeset 122638 59212ae7c2e679b1ecea44dd41b399ea4d85935d
parent 122637 9fa6f906758a087701560f39e935a9c34f53cfaa
child 122639 eaed4086d02bb5a8f4667c29aa2003dfb70900fb
push id2058
push userryanvm@gmail.com
push dateSat, 19 Jan 2013 22:46:54 +0000
treeherdermozilla-beta@eaed4086d02b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, akeybl
bugs826471
milestone19.0
Bug 826471 - Add JSAutoCompartment in nsWindowSH::NewResolve. r=bholley, a=akeybl
dom/base/nsDOMClassInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -7376,16 +7376,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;
     }