Bug 951847 - Push a cx in TestShellParent. r=gabor

This commit is contained in:
Bobby Holley
2014-01-01 19:23:55 -08:00
parent 029fc04f34
commit bcf8c70c9f

View File

@@ -10,6 +10,7 @@
#include "mozilla/dom/ContentParent.h"
#include "nsAutoPtr.h"
#include "nsCxPusher.h"
using namespace mozilla;
using mozilla::ipc::TestShellParent;
@@ -60,7 +61,8 @@ TestShellCommandParent::RunCallback(const nsString& aResponse)
{
NS_ENSURE_TRUE(*mCallback.ToJSValPtr() != JSVAL_NULL && mCx, false);
JSAutoRequest ar(mCx);
// We're pulling a cx off the heap, so make sure it's stack-top.
AutoCxPusher pusher(mCx);
NS_ENSURE_TRUE(mCallback.ToJSObject(), false);
JSAutoCompartment ac(mCx, mCallback.ToJSObject());
JS::Rooted<JSObject*> global(mCx, JS::CurrentGlobalOrNull(mCx));