Bug 1231337 - part 4, conditionally enable shared memory for ipc testshell. r=mrbkap
authorLars T Hansen <lhansen@mozilla.com>
Mon, 04 Jan 2016 14:54:55 +0100
changeset 279822 6346790559d1a5de9bd0632a6b009bd2f691e290
parent 279821 52655e7005b6b224522cdd61c3e47094d0745871
child 279823 068ab119a0f781ba85e34ec25e55efde1ca733ec
push id29889
push userryanvm@gmail.com
push dateThu, 14 Jan 2016 01:25:48 +0000
treeherdermozilla-central@3c473ad89a25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1231337
milestone46.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 1231337 - part 4, conditionally enable shared memory for ipc testshell. r=mrbkap
ipc/testshell/XPCShellEnvironment.cpp
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -511,16 +511,18 @@ XPCShellEnvironment::Init()
     if (NS_FAILED(rv)) {
         NS_ERROR("Failed to create backstage pass!");
         return false;
     }
 
     JS::CompartmentOptions options;
     options.creationOptions().setZone(JS::SystemZone);
     options.behaviors().setVersion(JSVERSION_LATEST);
+    if (xpc::SharedMemoryEnabled())
+        options.creationOptions().setSharedMemoryAndAtomicsEnabled(true);
 
     nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
     rv = xpc->InitClassesWithNewWrappedGlobal(cx,
                                               static_cast<nsIGlobalObject *>(backstagePass),
                                               principal, 0,
                                               options,
                                               getter_AddRefs(holder));
     if (NS_FAILED(rv)) {