Bug 889714 - Use the SafeJSContext in some test-only IPC code. r=me
☠☠ backed out by b3d0c2498b42 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Fri, 26 Jul 2013 18:56:52 -0700
changeset 148084 53e221a057cc113fe99d295a29963a79be485bef
parent 148083 193e8efe1350b9b5b36adb7370fa3b30a66d280e
child 148085 7b45f302e40e47cedd70422d80a3d994cae715c6
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs889714
milestone24.0a2
Bug 889714 - Use the SafeJSContext in some test-only IPC code. r=me
ipc/testshell/TestShellChild.cpp
--- a/ipc/testshell/TestShellChild.cpp
+++ b/ipc/testshell/TestShellChild.cpp
@@ -55,19 +55,18 @@ TestShellChild::RecvPTestShellCommandCon
   }
 
   return PTestShellCommandChild::Send__delete__(aActor, response);
 }
 
 PContextWrapperChild*
 TestShellChild::AllocPContextWrapper()
 {
-  JSContext* cx;
-  if (mXPCShell && (cx = mXPCShell->GetContext())) {
-    return new ContextWrapperChild(cx);
+  if (mXPCShell) {
+    return new ContextWrapperChild(nsContentUtils::GetSafeJSContext());
   }
   return NULL;
 }
 
 bool
 TestShellChild::DeallocPContextWrapper(PContextWrapperChild* actor)
 {
   delete actor;