Bug 834732 - Make SafeAutoJSContext actually push something. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Tue, 26 Feb 2013 11:04:10 -0800
changeset 123053 ebd40f774d14531e466ea36f7c5eaf4e13fa1243
parent 123052 7736f5d80843cc3b3bcc817852753af51d6909c0
child 123054 34e3e1156a7f177b8300a330bb18934174dd2f90
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs834732
milestone22.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 834732 - Make SafeAutoJSContext actually push something. r=mrbkap Currently it never does, because the SafeJSContext doesn't have an nsIScriptContext behind it. :-(
content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -6828,19 +6828,17 @@ AutoJSContext::Init(bool aSafe MOZ_GUARD
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
   if (!aSafe) {
     mCx = nsContentUtils::GetCurrentJSContext();
   }
 
   if (!mCx) {
     mCx = nsContentUtils::GetSafeJSContext();
-    // XXXbholley - This is totally wrong, but necessary to make this patch
-    // not change any behavior. We'll fix it in an upcoming patch.
-    bool result = mPusher.Push(mCx, nsCxPusher::REQUIRE_SCRIPT_CONTEXT);
+    bool result = mPusher.Push(mCx, nsCxPusher::ALWAYS_PUSH);
     if (!result || !mCx) {
       MOZ_CRASH();
     }
   }
 }
 
 AutoJSContext::operator JSContext*()
 {