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 123637 b7ceb5f0e97497f1f48bfda26f7582648fe3d4ff
parent 123636 28ecd8d04c24cebcf6b18a17934727f0ba6ac0af
child 123638 e184a4d4b0a56ad4c021a5907596ca4841799e90
push id3195
push userryanvm@gmail.com
push dateSun, 20 Jan 2013 04:13:04 +0000
treeherdermozilla-aurora@1145d8d79fbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, akeybl
bugs826471
milestone20.0a2
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
@@ -6859,16 +6859,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;
     }