Bug 1332530 - Don't require a SandboxStarter if MOZ_GMP_SANDBOX is not defined. r=jld
authorChris Pearce <cpearce@mozilla.com>
Wed, 25 Jan 2017 10:30:37 +1300
changeset 468465 6a31f295cd817cd2a26383d3f8ef1499a79b2370
parent 468464 6b3ca23424dc602c046fbe9275ffba1c31f2147b
child 468466 b599c9fa408006bb06b20febf41e8010a970ef35
push id43477
push userbmo:jhofmann@mozilla.com
push dateTue, 31 Jan 2017 15:48:49 +0000
reviewersjld
bugs1332530
milestone54.0a1
Bug 1332530 - Don't require a SandboxStarter if MOZ_GMP_SANDBOX is not defined. r=jld GMP gtests fail on ASAN builds now since the GMPLoader requires a sandbox starter, and ASAN doesn't run with a GMP sandbox. So only enforce that we need a sandbox starter if we've built with sandboxing enabled. MozReview-Commit-ID: GptxIZ7TFIy
dom/media/gmp/GMPChild.cpp
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -345,21 +345,23 @@ GMPChild::AnswerStartPlugin(const nsStri
   if (!GetUTF8LibPath(libPath)) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   auto platformAPI = new GMPPlatformAPI();
   InitPlatformAPI(*platformAPI, this);
 
   mGMPLoader = MakeUnique<GMPLoader>();
+#if defined(MOZ_GMP_SANDBOX)
   if (!mGMPLoader->CanSandbox()) {
     LOGD("%s Can't sandbox GMP, failing", __FUNCTION__);
     delete platformAPI;
     return IPC_FAIL_NO_REASON(this);
   }
+#endif
 
   bool isWidevine = aAdapter.EqualsLiteral("widevine");
 #if defined(MOZ_GMP_SANDBOX) && defined(XP_MACOSX)
   MacSandboxPluginType pluginType = MacSandboxPluginType_GMPlugin_Default;
   if (isWidevine) {
     pluginType = MacSandboxPluginType_GMPlugin_EME_Widevine;
   }
   if (!SetMacSandboxInfo(pluginType)) {