Bug 1332530 - Move GMPLoader code out of plugin-container and back into XUL. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Thu, 19 Jan 2017 15:39:03 +1300
changeset 378392 57c613d80dc3668c6ae92f8a4786ec4fbb4a543e
parent 378391 14c5ba1485bdc58adca8d02c68f095f2cba7ee8f
child 378393 6b3ca23424dc602c046fbe9275ffba1c31f2147b
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1332530
milestone54.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 1332530 - Move GMPLoader code out of plugin-container and back into XUL. r=gerald The GMPLoader code was in plugin-container so that it was covered by Adobe's voucher of plugin-container, but that's no longer necessary. MozReview-Commit-ID: 3VRBAohRI9I
dom/media/gmp/GMPChild.cpp
dom/media/gmp/GMPChild.h
dom/media/gmp/GMPLoader.cpp
dom/media/gmp/GMPLoader.h
dom/media/gmp/GMPProcessChild.cpp
dom/media/gmp/GMPProcessChild.h
dom/media/gmp/moz.build
ipc/app/moz.build
ipc/contentproc/plugin-container.cpp
toolkit/xre/nsEmbedFunctions.cpp
xpcom/build/XREChildData.h
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -344,17 +344,17 @@ GMPChild::AnswerStartPlugin(const nsStri
   nsCString libPath;
   if (!GetUTF8LibPath(libPath)) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   auto platformAPI = new GMPPlatformAPI();
   InitPlatformAPI(*platformAPI, this);
 
-  mGMPLoader = GMPProcessChild::GetGMPLoader();
+  mGMPLoader = CreateGMPLoader();
   if (!mGMPLoader) {
     NS_WARNING("Failed to get GMPLoader");
     delete platformAPI;
     return IPC_FAIL_NO_REASON(this);
   }
 
   bool isWidevine = aAdapter.EqualsLiteral("widevine");
 #if defined(MOZ_GMP_SANDBOX) && defined(XP_MACOSX)
--- a/dom/media/gmp/GMPChild.h
+++ b/dom/media/gmp/GMPChild.h
@@ -71,15 +71,15 @@ private:
   nsTArray<UniquePtr<GMPContentChild>> mGMPContentChildren;
 
   RefPtr<GMPTimerChild> mTimerChild;
   RefPtr<GMPStorageChild> mStorage;
 
   MessageLoop* mGMPMessageLoop;
   nsString mPluginPath;
   nsCString mNodeId;
-  GMPLoader* mGMPLoader;
+  UniquePtr<GMPLoader> mGMPLoader;
 };
 
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMPChild_h_
--- a/dom/media/gmp/GMPLoader.cpp
+++ b/dom/media/gmp/GMPLoader.cpp
@@ -5,16 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GMPLoader.h"
 #include <stdio.h>
 #include "mozilla/Attributes.h"
 #include "gmp-entrypoints.h"
 #include "prlink.h"
 #include "prenv.h"
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+#include "mozilla/sandboxTarget.h"
+#include "mozilla/sandboxing/SandboxInitialization.h"
+#include "mozilla/sandboxing/sandboxLogging.h"
+#endif
+#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
+#include "mozilla/Sandbox.h"
+#include "mozilla/SandboxInfo.h"
+#endif
 
 #include <string>
 
 #ifdef XP_WIN
 #include "windows.h"
 #endif
 
 namespace mozilla {
@@ -46,20 +55,16 @@ public:
   void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override;
 #endif
 
 private:
   UniquePtr<SandboxStarter> mSandboxStarter;
   UniquePtr<GMPAdapter> mAdapter;
 };
 
-UniquePtr<GMPLoader> CreateGMPLoader(UniquePtr<SandboxStarter> aStarter) {
-  return MakeUnique<GMPLoaderImpl>(Move(aStarter));
-}
-
 class PassThroughGMPAdapter : public GMPAdapter {
 public:
   ~PassThroughGMPAdapter() override {
     // Ensure we're always shutdown, even if caller forgets to call GMPShutdown().
     GMPShutdown();
   }
 
   void SetAdaptee(PRLibrary* aLib) override
@@ -192,11 +197,95 @@ GMPLoaderImpl::Shutdown()
 void
 GMPLoaderImpl::SetSandboxInfo(MacSandboxInfo* aSandboxInfo)
 {
   if (mSandboxStarter) {
     mSandboxStarter->SetSandboxInfo(aSandboxInfo);
   }
 }
 #endif
+
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+class WinSandboxStarter : public mozilla::gmp::SandboxStarter
+{
+public:
+  bool Start(const char *aLibPath) override
+  {
+    mozilla::SandboxTarget::Instance()->StartSandbox();
+    return true;
+  }
+};
+#endif
+
+#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
+class MacSandboxStarter : public mozilla::gmp::SandboxStarter
+{
+public:
+  bool Start(const char *aLibPath) override
+  {
+    std::string err;
+    bool rv = mozilla::StartMacSandbox(mInfo, err);
+    if (!rv) {
+      fprintf(stderr, "sandbox_init() failed! Error \"%s\"\n", err.c_str());
+    }
+    return rv;
+  }
+  void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override
+  {
+    mInfo = *aSandboxInfo;
+  }
+private:
+  MacSandboxInfo mInfo;
+};
+#endif
+
+#if defined (XP_LINUX) && defined(MOZ_GMP_SANDBOX)
+namespace {
+class LinuxSandboxStarter : public mozilla::gmp::SandboxStarter
+{
+private:
+  LinuxSandboxStarter() { }
+  friend mozilla::detail::UniqueSelector<LinuxSandboxStarter>::SingleObject mozilla::MakeUnique<LinuxSandboxStarter>();
+
+public:
+  static UniquePtr<SandboxStarter> Make()
+  {
+    if (mozilla::SandboxInfo::Get().CanSandboxMedia()) {
+      return MakeUnique<LinuxSandboxStarter>();
+    } else {
+      // Sandboxing isn't possible, but the parent has already
+      // checked that this plugin doesn't require it.  (Bug 1074561)
+      return nullptr;
+    }
+    return nullptr;
+  }
+  bool Start(const char *aLibPath) override
+  {
+    mozilla::SetMediaPluginSandbox(aLibPath);
+    return true;
+  }
+};
+} // anonymous namespace
+#endif // XP_LINUX && MOZ_GMP_SANDBOX
+
+
+static UniquePtr<SandboxStarter>
+MakeSandboxStarter()
+{
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+  return mozilla::MakeUnique<WinSandboxStarter>();
+#elif defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
+  return mozilla::MakeUnique<MacSandboxStarter>();
+#elif defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
+  return LinuxSandboxStarter::Make();
+#else
+  return nullptr;
+#endif
+}
+
+UniquePtr<GMPLoader>
+CreateGMPLoader()
+{
+  return MakeUnique<GMPLoaderImpl>(MakeSandboxStarter());
+}
+
 } // namespace gmp
 } // namespace mozilla
-
--- a/dom/media/gmp/GMPLoader.h
+++ b/dom/media/gmp/GMPLoader.h
@@ -98,14 +98,14 @@ public:
   // sandbox, which we don't yet know when the GMPLoader and SandboxStarter
   // objects are created.
   virtual void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) = 0;
 #endif
 };
 
 // On Desktop, this function resides in plugin-container.
 // On Mobile, this function resides in XUL.
-UniquePtr<GMPLoader> CreateGMPLoader(UniquePtr<SandboxStarter> aStarter);
+UniquePtr<GMPLoader> CreateGMPLoader();
 
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMP_LOADER_H__
--- a/dom/media/gmp/GMPProcessChild.cpp
+++ b/dom/media/gmp/GMPProcessChild.cpp
@@ -53,26 +53,10 @@ GMPProcessChild::Init()
 }
 
 void
 GMPProcessChild::CleanUp()
 {
   BackgroundHangMonitor::Shutdown();
 }
 
-GMPLoader* GMPProcessChild::mLoader = nullptr;
-
-/* static */
-void
-GMPProcessChild::SetGMPLoader(GMPLoader* aLoader)
-{
-  mLoader = aLoader;
-}
-
-/* static */
-GMPLoader*
-GMPProcessChild::GetGMPLoader()
-{
-  return mLoader;
-}
-
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPProcessChild.h
+++ b/dom/media/gmp/GMPProcessChild.h
@@ -20,24 +20,17 @@ protected:
 
 public:
   explicit GMPProcessChild(ProcessId aParentPid);
   ~GMPProcessChild();
 
   bool Init() override;
   void CleanUp() override;
 
-  // Set/get the GMPLoader singleton for this child process.
-  // Note: The GMPLoader is not deleted by this object, the caller of
-  // SetGMPLoader() must manage the GMPLoader's lifecycle.
-  static void SetGMPLoader(GMPLoader* aHost);
-  static GMPLoader* GetGMPLoader();
-
 private:
   GMPChild mPlugin;
-  static GMPLoader* mLoader;
   DISALLOW_COPY_AND_ASSIGN(GMPProcessChild);
 };
 
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMPProcessChild_h_
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -61,34 +61,28 @@ EXPORTS += [
     'GMPVideoEncoderParent.h',
     'GMPVideoEncoderProxy.h',
     'GMPVideoHost.h',
     'GMPVideoi420FrameImpl.h',
     'GMPVideoPlaneImpl.h',
     'widevine-adapter/content_decryption_module.h',
 ]
 
-# We link GMPLoader into xul on Android and Linux as its code does not
-# need to be covered by a DRM vendor's voucher.
-if CONFIG['OS_ARCH'] == 'Linux':
-    SOURCES += [
-      'GMPLoader.cpp',
-    ]
-
 UNIFIED_SOURCES += [
     'GMPCDMCallbackProxy.cpp',
     'GMPCDMProxy.cpp',
     'GMPChild.cpp',
     'GMPContentChild.cpp',
     'GMPContentParent.cpp',
     'GMPCrashHelper.cpp',
     'GMPDecryptorChild.cpp',
     'GMPDecryptorParent.cpp',
     'GMPDiskStorage.cpp',
     'GMPEncryptedBufferDataImpl.cpp',
+    'GMPLoader.cpp',
     'GMPMemoryStorage.cpp',
     'GMPParent.cpp',
     'GMPPlatform.cpp',
     'GMPProcessChild.cpp',
     'GMPProcessParent.cpp',
     'GMPService.cpp',
     'GMPServiceChild.cpp',
     'GMPServiceParent.cpp',
@@ -124,16 +118,24 @@ IPDL_SOURCES += [
   'PGMPVideoEncoder.ipdl',
 ]
 
 # comment this out to use Unsafe Shmem for more performance
 DEFINES['GMP_SAFE_SHMEM'] = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+if CONFIG['MOZ_SANDBOX']:
+    # For sandbox includes and the include dependencies those have
+    LOCAL_INCLUDES += [
+        '/security/sandbox/chromium',
+        '/security/sandbox/chromium-shim',
+    ]
+
+
 FINAL_LIBRARY = 'xul'
 # media/mtransport so we work with --disable-webrtc
 LOCAL_INCLUDES += [
     '/media/mtransport',
     '/xpcom/base',
     '/xpcom/build',
     '/xpcom/threads',
 ]
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -22,23 +22,16 @@ else:
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/toolkit/xre',
     '/xpcom/base',
 ]
 
-# We link GMPLoader into plugin-container on desktop so that its code is
-# covered by the desktop DRM vendor's voucher.
-if CONFIG['OS_ARCH'] != 'Linux':
-    SOURCES += [
-        '../../dom/media/gmp/GMPLoader.cpp',
-    ]
-
 # DELAYLOAD_DLLS in this block ensures that the DLL blocklist is functional
 if CONFIG['OS_ARCH'] == 'WINNT':
     DELAYLOAD_DLLS += [
         'nss3.dll',
     ]
 
     if CONFIG['MOZ_SANDBOX']:
         # For sandbox includes and the include dependencies those have
--- a/ipc/contentproc/plugin-container.cpp
+++ b/ipc/contentproc/plugin-container.cpp
@@ -16,66 +16,21 @@
 #define XRE_DONT_PROTECT_DLL_LOAD
 #include "nsWindowsWMain.cpp"
 #include "nsSetDllDirectory.h"
 #else
 // FIXME/cjones testing
 #include <unistd.h>
 #endif
 
-#include "GMPLoader.h"
-
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
 #include "mozilla/sandboxing/SandboxInitialization.h"
 #include "mozilla/sandboxing/sandboxLogging.h"
 #endif
 
-#if defined(XP_WIN) && defined(MOZ_SANDBOX)
-class WinSandboxStarter : public mozilla::gmp::SandboxStarter {
-public:
-    virtual bool Start(const char *aLibPath) override {
-        if (IsSandboxedProcess()) {
-            mozilla::sandboxing::LowerSandbox();
-        }
-        return true;
-    }
-};
-#endif
-
-#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
-class MacSandboxStarter : public mozilla::gmp::SandboxStarter {
-public:
-    bool Start(const char *aLibPath) override {
-      std::string err;
-      bool rv = mozilla::StartMacSandbox(mInfo, err);
-      if (!rv) {
-        fprintf(stderr, "sandbox_init() failed! Error \"%s\"\n", err.c_str());
-      }
-      return rv;
-    }
-    void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override {
-      mInfo = *aSandboxInfo;
-    }
-private:
-  MacSandboxInfo mInfo;
-};
-#endif
-
-mozilla::UniquePtr<mozilla::gmp::SandboxStarter>
-MakeSandboxStarter()
-{
-#if defined(XP_WIN) && defined(MOZ_SANDBOX)
-    return mozilla::MakeUnique<WinSandboxStarter>();
-#elif defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
-    return mozilla::MakeUnique<MacSandboxStarter>();
-#else
-    return nullptr;
-#endif
-}
-
 int
 content_process_main(mozilla::Bootstrap* bootstrap, int argc, char* argv[])
 {
     // Check for the absolute minimum number of args we need to move
     // forward here. We expect the last arg to be the child process type.
     if (argc < 1) {
       return 3;
     }
@@ -100,18 +55,12 @@ content_process_main(mozilla::Bootstrap*
     // For plugins, this is done in PluginProcessChild::Init, as we need to
     // avoid it for unsupported plugins.  See PluginProcessChild::Init for
     // the details.
     if (bootstrap->XRE_GetProcessType() != GeckoProcessType_Plugin) {
         mozilla::SanitizeEnvironmentVariables();
         SetDllDirectoryW(L"");
     }
 #endif
-#if !defined(XP_LINUX) && defined(MOZ_PLUGIN_CONTAINER)
-    // On Windows and MacOS, the GMPLoader lives in plugin-container, so that its
-    // code can be covered by an EME/GMP vendor's voucher.
-    if (bootstrap->XRE_GetProcessType() == GeckoProcessType_GMPlugin) {
-        childData.gmpLoader = mozilla::gmp::CreateGMPLoader(MakeSandboxStarter());
-    }
-#endif
+
     nsresult rv = bootstrap->XRE_InitChildProcess(argc, argv, &childData);
     return NS_FAILED(rv);
 }
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -65,17 +65,16 @@
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentChild.h"
 
 #include "mozilla/ipc/TestShellParent.h"
 #include "mozilla/ipc/XPCShellEnvironment.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
 #include "GMPProcessChild.h"
-#include "GMPLoader.h"
 #include "mozilla/gfx/GPUProcessImpl.h"
 
 #include "GeckoProfiler.h"
 
 #include "mozilla/Telemetry.h"
 
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
 #include "mozilla/sandboxTarget.h"
@@ -110,18 +109,16 @@ using mozilla::ipc::IOThreadChild;
 using mozilla::ipc::ProcessChild;
 using mozilla::ipc::ScopedXREEmbed;
 
 using mozilla::plugins::PluginProcessChild;
 using mozilla::dom::ContentProcess;
 using mozilla::dom::ContentParent;
 using mozilla::dom::ContentChild;
 
-using mozilla::gmp::GMPLoader;
-using mozilla::gmp::CreateGMPLoader;
 using mozilla::gmp::GMPProcessChild;
 
 using mozilla::ipc::TestShellParent;
 using mozilla::ipc::TestShellCommandParent;
 using mozilla::ipc::XPCShellEnvironment;
 
 using mozilla::startup::sChildProcessType;
 
@@ -323,42 +320,16 @@ AddContentSandboxLevelAnnotation()
     levelString.AppendInt(level);
     CrashReporter::AnnotateCrashReport(
       NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString);
   }
 }
 #endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
 #endif /* MOZ_CRASHREPORTER */
 
-#if defined (XP_LINUX) && defined(MOZ_GMP_SANDBOX)
-namespace {
-class LinuxSandboxStarter : public mozilla::gmp::SandboxStarter {
-private:
-  LinuxSandboxStarter() { }
-  friend mozilla::detail::UniqueSelector<LinuxSandboxStarter>::SingleObject mozilla::MakeUnique<LinuxSandboxStarter>();
-
-public:
-  static UniquePtr<SandboxStarter> Make() {
-    if (mozilla::SandboxInfo::Get().CanSandboxMedia()) {
-      return MakeUnique<LinuxSandboxStarter>();
-    } else {
-      // Sandboxing isn't possible, but the parent has already
-      // checked that this plugin doesn't require it.  (Bug 1074561)
-      return nullptr;
-    }
-    return nullptr;
-  }
-  virtual bool Start(const char *aLibPath) override {
-    mozilla::SetMediaPluginSandbox(aLibPath);
-    return true;
-  }
-};
-} // anonymous namespace
-#endif // XP_LINUX && MOZ_GMP_SANDBOX
-
 nsresult
 XRE_InitChildProcess(int aArgc,
                      char* aArgv[],
                      const XREChildData* aChildData)
 {
   NS_ENSURE_ARG_MIN(aArgc, 2);
   NS_ENSURE_ARG_POINTER(aArgv);
   NS_ENSURE_ARG_POINTER(aArgv[0]);
@@ -369,36 +340,16 @@ XRE_InitChildProcess(int aArgc,
     mozilla::SandboxEarlyInit(XRE_GetProcessType());
 #endif
 
 #ifdef MOZ_JPROF
   // Call the code to install our handler
   setupProfilingStuff();
 #endif
 
-#ifdef XP_LINUX
-  // On Fennec, the GMPLoader's code resides inside XUL (because for the time
-  // being GMPLoader relies upon NSPR, which we can't use in plugin-container
-  // on Android), so we create it here inside XUL and pass it to the GMP code.
-  //
-  // On desktop Linux, the sandbox code lives in a shared library, and
-  // the GMPLoader is in libxul instead of executables to avoid unwanted
-  // library dependencies.
-  UniquePtr<mozilla::gmp::SandboxStarter> starter;
-#ifdef MOZ_GMP_SANDBOX
-  starter = LinuxSandboxStarter::Make();
-#endif
-  UniquePtr<GMPLoader> loader = CreateGMPLoader(Move(starter));
-  GMPProcessChild::SetGMPLoader(loader.get());
-#else
-  // On non-Linux platforms, the GMPLoader code resides in plugin-container,
-  // and we must forward it through to the GMP code here.
-  GMPProcessChild::SetGMPLoader(aChildData->gmpLoader.get());
-#endif
-
 #if defined(XP_WIN)
   // From the --attach-console support in nsNativeAppSupportWin.cpp, but
   // here we are a content child process, so we always attempt to attach
   // to the parent's (ie, the browser's) console.
   // Try to attach console to the parent process.
   // It will succeed when the parent process is a command line,
   // so that stdio will be displayed in it.
   if (AttachConsole(ATTACH_PARENT_PROCESS)) {
@@ -513,43 +464,43 @@ XRE_InitChildProcess(int aArgc,
 
   if (err != KERN_SUCCESS) {
     NS_WARNING("child task_set_bootstrap_port() failed");
     return NS_ERROR_FAILURE;
   }
 
 #endif
 
-  SetupErrorHandling(aArgv[0]);  
+  SetupErrorHandling(aArgv[0]);
 
 #if defined(MOZ_CRASHREPORTER)
   if (aArgc < 1)
     return NS_ERROR_FAILURE;
   const char* const crashReporterArg = aArgv[--aArgc];
-  
+
 #  if defined(XP_WIN) || defined(XP_MACOSX)
   // on windows and mac, |crashReporterArg| is the named pipe on which the
   // server is listening for requests, or "-" if crash reporting is
   // disabled.
-  if (0 != strcmp("-", crashReporterArg) && 
+  if (0 != strcmp("-", crashReporterArg) &&
       !XRE_SetRemoteExceptionHandler(crashReporterArg)) {
     // Bug 684322 will add better visibility into this condition
     NS_WARNING("Could not setup crash reporting\n");
   }
 #  elif defined(OS_LINUX)
   // on POSIX, |crashReporterArg| is "true" if crash reporting is
   // enabled, false otherwise
-  if (0 != strcmp("false", crashReporterArg) && 
+  if (0 != strcmp("false", crashReporterArg) &&
       !XRE_SetRemoteExceptionHandler(nullptr)) {
     // Bug 684322 will add better visibility into this condition
     NS_WARNING("Could not setup crash reporting\n");
   }
 #  else
 #    error "OOP crash reporting unsupported on this platform"
-#  endif   
+#  endif
 #endif // if defined(MOZ_CRASHREPORTER)
 
   gArgv = aArgv;
   gArgc = aArgc;
 
 #ifdef MOZ_X11
   XInitThreads();
 #endif
@@ -702,17 +653,17 @@ XRE_InitChildProcess(int aArgc,
 #endif /* XP_MACOSX && MOZ_CONTENT_SANDBOX */
           }
         }
         break;
 
       case GeckoProcessType_IPDLUnitTest:
 #ifdef MOZ_IPDL_TESTS
         process = new IPDLUnitTestProcessChild(parentPID);
-#else 
+#else
         MOZ_CRASH("rebuild with --enable-ipdl-tests");
 #endif
         break;
 
       case GeckoProcessType_GMPlugin:
         process = new gmp::GMPProcessChild(parentPID);
         break;
 
@@ -789,17 +740,17 @@ class MainFunctionRunnable : public Runn
 {
 public:
   NS_DECL_NSIRUNNABLE
 
   MainFunctionRunnable(MainFunction aFunction,
                        void* aData)
   : mFunction(aFunction),
     mData(aData)
-  { 
+  {
     NS_ASSERTION(aFunction, "Don't give me a null pointer!");
   }
 
 private:
   MainFunction mFunction;
   void* mData;
 };
 
@@ -886,33 +837,33 @@ XRE_RunAppShell()
 #if defined(XP_MACOSX)
     {
       // In content processes that want XPCOM (and hence want
       // AppShell), we usually run our hybrid event loop through
       // MessagePump::Run(), by way of nsBaseAppShell::Run().  The
       // Cocoa nsAppShell impl, however, implements its own Run()
       // that's unaware of MessagePump.  That's all rather suboptimal,
       // but oddly enough not a problem... usually.
-      // 
+      //
       // The problem with this setup comes during startup.
       // XPCOM-in-subprocesses depends on IPC, e.g. to init the pref
       // service, so we have to init IPC first.  But, IPC also
       // indirectly kinda-depends on XPCOM, because MessagePump
       // schedules work from off-main threads (e.g. IO thread) by
       // using NS_DispatchToMainThread().  If the IO thread receives a
       // Message from the parent before nsThreadManager is
       // initialized, then DispatchToMainThread() will fail, although
       // MessagePump will remember the task.  This race condition
       // isn't a problem when appShell->Run() ends up in
       // MessagePump::Run(), because MessagePump will immediate see it
       // has work to do.  It *is* a problem when we end up in [NSApp
       // run], because it's not aware that MessagePump has work that
       // needs to be processed; that was supposed to be signaled by
       // nsIRunnable(s).
-      // 
+      //
       // So instead of hacking Cocoa nsAppShell or rewriting the
       // event-loop system, we compromise here by processing any tasks
       // that might have been enqueued on MessagePump, *before*
       // MessagePump::ScheduleWork was able to successfully
       // DispatchToMainThread().
       MessageLoop* loop = MessageLoop::current();
       bool couldNest = loop->NestableTasksAllowed();
 
--- a/xpcom/build/XREChildData.h
+++ b/xpcom/build/XREChildData.h
@@ -12,34 +12,21 @@
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
 #include "mozilla/sandboxing/loggingTypes.h"
 
 namespace sandbox {
 class TargetServices;
 }
 #endif
 
-namespace mozilla {
-namespace gmp {
-class GMPLoader;
-}
-}
-
 /**
  * Data needed to start a child process.
  */
 struct XREChildData
 {
-#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK)
-  /**
-   * Used to load the GMP binary.
-   */
-  mozilla::UniquePtr<mozilla::gmp::GMPLoader> gmpLoader;
-#endif
-
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   /**
    * Chromium sandbox TargetServices.
    */
   sandbox::TargetServices* sandboxTargetServices = nullptr;
 
   /**
    * Function to provide a logging function to the chromium sandbox code.