Bug 1332530 - Don't require a SandboxStarter if MOZ_GMP_SANDBOX is not defined. r=jld draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 25 Jan 2017 10:30:37 +1300
changeset 468232 6265f91a9c80555b63f71ac5da116450d4728df1
parent 468231 e869cf9b25bdf3b5a6e6cbdcbd8c521987f826cb
child 468233 8b57219ff8856dfa33476c57449a55c9e12a5d37
push id43390
push usercpearce@mozilla.com
push dateMon, 30 Jan 2017 22:24:14 +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)) {