Bug 1500454 - remove PVideoDecoder, etc from dom namespace. r=jya
authorMichael Froman <mfroman@mozilla.com>
Fri, 21 Dec 2018 22:34:57 +0000
changeset 508876 b723ef9caca92c5b4635f352671eafc2737a3735
parent 508875 3c3eb5325c17b2a93d4a587242fb5dd732415e9b
child 508877 48b059d9a1de4540d2ce9f92abf9eb058c188cf1
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1500454
milestone66.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 1500454 - remove PVideoDecoder, etc from dom namespace. r=jya Differential Revision: https://phabricator.services.mozilla.com/D15156
dom/ipc/ContentChild.cpp
dom/media/ipc/GpuDecoderModule.cpp
dom/media/ipc/PVideoDecoder.ipdl
dom/media/ipc/PVideoDecoderManager.ipdl
dom/media/ipc/VideoDecoderChild.cpp
dom/media/ipc/VideoDecoderChild.h
dom/media/ipc/VideoDecoderManagerChild.cpp
dom/media/ipc/VideoDecoderManagerChild.h
dom/media/ipc/VideoDecoderManagerParent.cpp
dom/media/ipc/VideoDecoderManagerParent.h
dom/media/ipc/VideoDecoderParent.cpp
dom/media/ipc/VideoDecoderParent.h
dom/media/ipc/moz.build
gfx/ipc/GPUParent.cpp
gfx/ipc/GPUProcessManager.cpp
gfx/ipc/GPUProcessManager.h
gfx/layers/GPUVideoImage.h
gfx/layers/client/GPUVideoTextureClient.cpp
gfx/layers/client/GPUVideoTextureClient.h
gfx/layers/composite/GPUVideoTextureHost.cpp
xpcom/build/XPCOMInit.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -20,26 +20,26 @@
 #include "mozilla/MemoryTelemetry.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ProcessHangMonitorIPC.h"
 #include "mozilla/RemoteDecoderManagerChild.h"
 #include "mozilla/Unused.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/TelemetryIPC.h"
+#include "mozilla/VideoDecoderManagerChild.h"
 #include "mozilla/devtools/HeapSnapshotTempFileHelperChild.h"
 #include "mozilla/docshell/OfflineCacheUpdateChild.h"
 #include "mozilla/dom/ClientManager.h"
 #include "mozilla/dom/ClientOpenWindowOpActors.h"
 #include "mozilla/dom/ChildProcessMessageManager.h"
 #include "mozilla/dom/ContentBridgeChild.h"
 #include "mozilla/dom/ContentBridgeParent.h"
 #include "mozilla/dom/ContentProcessMessageManager.h"
 #include "mozilla/dom/DOMPrefs.h"
-#include "mozilla/dom/VideoDecoderManagerChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/ExternalHelperAppChild.h"
 #include "mozilla/dom/FileCreatorHelper.h"
 #include "mozilla/dom/GetFilesHelper.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/LSObject.h"
--- a/dom/media/ipc/GpuDecoderModule.cpp
+++ b/dom/media/ipc/GpuDecoderModule.cpp
@@ -3,26 +3,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "GpuDecoderModule.h"
 
 #include "base/thread.h"
 #include "mozilla/layers/SynchronousTask.h"
 #include "mozilla/StaticPrefs.h"
+#include "VideoDecoderChild.h"
+#include "VideoDecoderManagerChild.h"
 
 #include "RemoteMediaDataDecoder.h"
-#include "VideoDecoderChild.h"
-#include "VideoDecoderManagerChild.h"
 
 namespace mozilla {
 
 using base::Thread;
-using dom::VideoDecoderChild;
-using dom::VideoDecoderManagerChild;
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 nsresult GpuDecoderModule::Startup() {
   if (!VideoDecoderManagerChild::GetManagerThread()) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/media/ipc/PVideoDecoder.ipdl
+++ b/dom/media/ipc/PVideoDecoder.ipdl
@@ -6,17 +6,16 @@
 include "mozilla/dom/MediaIPCUtils.h";
 
 include protocol PVideoDecoderManager;
 include PMediaDecoderParams;
 include LayersSurfaces;
 using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
 
 namespace mozilla {
-namespace dom {
 
 struct VideoDataIPDL
 {
   MediaDataIPDL base;
   IntSize display;
   IntSize frameSize;
   SurfaceDescriptorGPUVideo sd;
   int32_t frameID;
@@ -54,10 +53,9 @@ child:
   // must be released explicitly using DeallocateSurfaceDescriptorGPUVideo
   // on the manager protocol.
   async Output(VideoDataIPDL data);
   async InputExhausted();
   async DrainComplete();
   async Error(nsresult error);
 };
 
-} // namespace dom
 } // namespace mozilla
--- a/dom/media/ipc/PVideoDecoderManager.ipdl
+++ b/dom/media/ipc/PVideoDecoderManager.ipdl
@@ -8,17 +8,16 @@ include protocol PVideoDecoder;
 include LayersSurfaces;
 include "mozilla/dom/MediaIPCUtils.h";
 using VideoInfo from "MediaInfo.h";
 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
 using mozilla::CreateDecoderParams::Option from "PlatformDecoderModule.h";
 using mozilla::CreateDecoderParams::OptionSet from "PlatformDecoderModule.h";
 
 namespace mozilla {
-namespace dom {
 
 sync protocol PVideoDecoderManager
 {
   manages PVideoDecoder;
 parent:
   // aBlacklistedD3D11Driver and aBlacklistedD3D9Driver are used to read back the blacklisted driver information
   // from GPU process to content process.
   // We should have added a new sync method to read back this information but, in that way, we also introduce one
@@ -31,10 +30,9 @@ parent:
                   nsCString aBlacklistedD3D9Driver,
                   nsCString aErrorDescription);
 
   sync Readback(SurfaceDescriptorGPUVideo sd) returns (SurfaceDescriptor aResult);
 
   async DeallocateSurfaceDescriptorGPUVideo(SurfaceDescriptorGPUVideo sd);
 };
 
-} // namespace dom
 } // namespace mozilla
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/layers/TextureClient.h"
 #include "mozilla/Telemetry.h"
 #include "base/thread.h"
 #include "MediaInfo.h"
 #include "ImageContainer.h"
 #include "GPUVideoImage.h"
 
 namespace mozilla {
-namespace dom {
 
 using base::Thread;
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 #ifdef XP_WIN
 static void ReportUnblacklistingTelemetry(
@@ -122,17 +121,17 @@ void VideoDecoderChild::ActorDestroy(Act
   if (aWhy == AbnormalShutdown) {
     // GPU process crashed, record the time and send back to MFR for telemetry.
     mGPUCrashTime = TimeStamp::Now();
 
     // Defer reporting an error until we've recreated the manager so that
     // it'll be safe for MediaFormatReader to recreate decoders
     RefPtr<VideoDecoderChild> ref = this;
     GetManager()->RunWhenRecreated(
-        NS_NewRunnableFunction("dom::VideoDecoderChild::ActorDestroy", [=]() {
+        NS_NewRunnableFunction("VideoDecoderChild::ActorDestroy", [=]() {
           MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
           error.SetGPUCrashTimeStamp(ref->mGPUCrashTime);
           if (ref->mInitialized) {
             mDecodedData = MediaDataDecoder::DecodedData();
             mDecodePromise.RejectIfExists(error, __func__);
             mDrainPromise.RejectIfExists(error, __func__);
             mFlushPromise.RejectIfExists(error, __func__);
             // Make sure the next request will be rejected accordingly if ever
@@ -321,10 +320,9 @@ void VideoDecoderChild::AssertOnManagerT
 
 VideoDecoderManagerChild* VideoDecoderChild::GetManager() {
   if (!mCanSend) {
     return nullptr;
   }
   return static_cast<VideoDecoderManagerChild*>(Manager());
 }
 
-}  // namespace dom
 }  // namespace mozilla
--- a/dom/media/ipc/VideoDecoderChild.h
+++ b/dom/media/ipc/VideoDecoderChild.h
@@ -1,23 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef include_dom_ipc_VideoDecoderChild_h
-#define include_dom_ipc_VideoDecoderChild_h
+#ifndef include_ipc_VideoDecoderChild_h
+#define include_ipc_VideoDecoderChild_h
 
 #include "MediaResult.h"
 #include "PlatformDecoderModule.h"
-#include "mozilla/dom/PVideoDecoderChild.h"
+#include "mozilla/PVideoDecoderChild.h"
 #include "IRemoteDecoderChild.h"
 
 namespace mozilla {
-namespace dom {
 
 class RemoteVideoDecoder;
 class RemoteDecoderModule;
 class VideoDecoderManagerChild;
 
 class VideoDecoderChild final : public PVideoDecoderChild,
                                 public IRemoteDecoderChild {
  public:
@@ -83,12 +82,11 @@ class VideoDecoderChild final : public P
   bool mNeedNewDecoder;
   MediaDataDecoder::DecodedData mDecodedData;
 
   nsCString mBlacklistedD3D11Driver;
   nsCString mBlacklistedD3D9Driver;
   TimeStamp mGPUCrashTime;
 };
 
-}  // namespace dom
 }  // namespace mozilla
 
-#endif  // include_dom_ipc_VideoDecoderChild_h
+#endif  // include_ipc_VideoDecoderChild_h
--- a/dom/media/ipc/VideoDecoderManagerChild.cpp
+++ b/dom/media/ipc/VideoDecoderManagerChild.cpp
@@ -1,27 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "VideoDecoderManagerChild.h"
 #include "VideoDecoderChild.h"
+#include "nsThreadUtils.h"
 #include "mozilla/dom/ContentChild.h"
-#include "nsThreadUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 #include "mozilla/layers/SynchronousTask.h"
 #include "mozilla/gfx/DataSurfaceHelpers.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "base/task.h"
 
 namespace mozilla {
-namespace dom {
 
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 // Only modified on the main-thread
 StaticRefPtr<nsIThread> sVideoDecoderChildThread;
 StaticRefPtr<AbstractThread> sVideoDecoderChildAbstractThread;
@@ -55,17 +54,17 @@ static UniquePtr<nsTArray<RefPtr<Runnabl
       NS_DISPATCH_NORMAL);
 }
 
 /* static */ void VideoDecoderManagerChild::Shutdown() {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sVideoDecoderChildThread) {
     sVideoDecoderChildThread->Dispatch(
-        NS_NewRunnableFunction("dom::VideoDecoderManagerChild::Shutdown",
+        NS_NewRunnableFunction("VideoDecoderManagerChild::Shutdown",
                                []() {
                                  if (sDecoderManager &&
                                      sDecoderManager->CanSend()) {
                                    sDecoderManager->Close();
                                    sDecoderManager = nullptr;
                                  }
                                }),
         NS_DISPATCH_NORMAL);
@@ -159,17 +158,17 @@ bool VideoDecoderManagerChild::CanSend()
   return mCanSend;
 }
 
 bool VideoDecoderManagerChild::DeallocShmem(mozilla::ipc::Shmem& aShmem) {
   if (NS_GetCurrentThread() != sVideoDecoderChildThread) {
     RefPtr<VideoDecoderManagerChild> self = this;
     mozilla::ipc::Shmem shmem = aShmem;
     sVideoDecoderChildThread->Dispatch(
-        NS_NewRunnableFunction("dom::VideoDecoderManagerChild::DeallocShmem",
+        NS_NewRunnableFunction("VideoDecoderManagerChild::DeallocShmem",
                                [self, shmem]() {
                                  if (self->CanSend()) {
                                    mozilla::ipc::Shmem shmemCopy = shmem;
                                    self->DeallocShmem(shmemCopy);
                                  }
                                }),
         NS_DISPATCH_NORMAL);
     return true;
@@ -236,23 +235,22 @@ already_AddRefed<SourceSurface> VideoDec
 }
 
 void VideoDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo(
     const SurfaceDescriptorGPUVideo& aSD) {
   RefPtr<VideoDecoderManagerChild> ref = this;
   SurfaceDescriptorGPUVideo sd = std::move(aSD);
   sVideoDecoderChildThread->Dispatch(
       NS_NewRunnableFunction(
-          "dom::VideoDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo",
+          "VideoDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo",
           [ref, sd]() {
             if (ref->CanSend()) {
               ref->SendDeallocateSurfaceDescriptorGPUVideo(sd);
             }
           }),
       NS_DISPATCH_NORMAL);
 }
 
 void VideoDecoderManagerChild::HandleFatalError(const char* aMsg) const {
   dom::ContentChild::FatalErrorIfNotUsingGPUProcess(aMsg, OtherPid());
 }
 
-}  // namespace dom
 }  // namespace mozilla
--- a/dom/media/ipc/VideoDecoderManagerChild.h
+++ b/dom/media/ipc/VideoDecoderManagerChild.h
@@ -1,24 +1,23 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef include_dom_ipc_VideoDecoderManagerChild_h
-#define include_dom_ipc_VideoDecoderManagerChild_h
+#ifndef include_ipc_VideoDecoderManagerChild_h
+#define include_ipc_VideoDecoderManagerChild_h
 
 #include "mozilla/RefPtr.h"
-#include "mozilla/dom/PVideoDecoderManagerChild.h"
+#include "mozilla/PVideoDecoderManagerChild.h"
 
 namespace mozilla {
 namespace gfx {
 class SourceSurface;
 }
-namespace dom {
 
 class VideoDecoderManagerChild final : public PVideoDecoderManagerChild,
                                        public mozilla::ipc::IShmemAllocator {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderManagerChild)
 
   // Can only be called from the manager thread
   static VideoDecoderManagerChild* GetSingleton();
@@ -88,12 +87,11 @@ class VideoDecoderManagerChild final : p
   static void Open(Endpoint<PVideoDecoderManagerChild>&& aEndpoint);
 
   RefPtr<VideoDecoderManagerChild> mIPDLSelfRef;
 
   // Should only ever be accessed on the manager thread.
   bool mCanSend;
 };
 
-}  // namespace dom
 }  // namespace mozilla
 
-#endif  // include_dom_ipc_VideoDecoderManagerChild_h
+#endif  // include_ipc_VideoDecoderManagerChild_h
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -25,18 +25,16 @@
 
 namespace mozilla {
 
 #ifdef XP_WIN
 extern const nsCString GetFoundD3D11BlacklistedDLL();
 extern const nsCString GetFoundD3D9BlacklistedDLL();
 #endif  // XP_WIN
 
-namespace dom {
-
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 SurfaceDescriptorGPUVideo VideoDecoderManagerParent::StoreImage(
     Image* aImage, TextureClient* aTexture) {
   SurfaceDescriptorGPUVideo ret;
   aTexture->GPUVideoDesc(&ret);
@@ -53,17 +51,17 @@ class VideoDecoderManagerThreadHolder {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderManagerThreadHolder)
 
  public:
   VideoDecoderManagerThreadHolder() {}
 
  private:
   ~VideoDecoderManagerThreadHolder() {
     NS_DispatchToMainThread(
-        NS_NewRunnableFunction("dom::VideoDecoderManagerThreadHolder::~"
+        NS_NewRunnableFunction("VideoDecoderManagerThreadHolder::~"
                                "VideoDecoderManagerThreadHolder",
                                []() -> void {
                                  sVideoDecoderManagerThread->Shutdown();
                                  sVideoDecoderManagerThread = nullptr;
                                }));
   }
 };
 StaticRefPtr<VideoDecoderManagerThreadHolder> sVideoDecoderManagerThreadHolder;
@@ -111,17 +109,17 @@ void VideoDecoderManagerParent::StartupT
                              []() {
                                DebugOnly<HRESULT> hr =
                                    CoInitializeEx(0, COINIT_MULTITHREADED);
                                MOZ_ASSERT(hr == S_OK);
                              }),
       NS_DISPATCH_NORMAL);
 #endif
   sVideoDecoderManagerThread->Dispatch(
-      NS_NewRunnableFunction("dom::VideoDecoderManagerParent::StartupThreads",
+      NS_NewRunnableFunction("VideoDecoderManagerParent::StartupThreads",
                              []() { layers::VideoBridgeChild::Startup(); }),
       NS_DISPATCH_NORMAL);
 
   sManagerTaskQueue = new TaskQueue(
       managerThread.forget(), "VideoDecoderManagerParent::sManagerTaskQueue");
 
   auto* obs = new ManagerThreadShutdownObserver();
   observerService->AddObserver(obs, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
@@ -135,19 +133,19 @@ void VideoDecoderManagerParent::Shutdown
   sVideoDecoderManagerThreadHolder = nullptr;
   while (sVideoDecoderManagerThread) {
     NS_ProcessNextEvent(nullptr, true);
   }
 }
 
 void VideoDecoderManagerParent::ShutdownVideoBridge() {
   if (sVideoDecoderManagerThread) {
-    RefPtr<Runnable> task = NS_NewRunnableFunction(
-        "dom::VideoDecoderManagerParent::ShutdownVideoBridge",
-        []() { VideoBridgeChild::Shutdown(); });
+    RefPtr<Runnable> task =
+        NS_NewRunnableFunction("VideoDecoderManagerParent::ShutdownVideoBridge",
+                               []() { VideoBridgeChild::Shutdown(); });
     SyncRunnable::DispatchToThread(sVideoDecoderManagerThread, task);
   }
 }
 
 bool VideoDecoderManagerParent::OnManagerThread() {
   return NS_GetCurrentThread() == sVideoDecoderManagerThread;
 }
 
@@ -161,17 +159,17 @@ bool VideoDecoderManagerParent::CreateFo
     return false;
   }
 
   RefPtr<VideoDecoderManagerParent> parent =
       new VideoDecoderManagerParent(sVideoDecoderManagerThreadHolder);
 
   RefPtr<Runnable> task =
       NewRunnableMethod<Endpoint<PVideoDecoderManagerParent>&&>(
-          "dom::VideoDecoderManagerParent::Open", parent,
+          "VideoDecoderManagerParent::Open", parent,
           &VideoDecoderManagerParent::Open, std::move(aEndpoint));
   sVideoDecoderManagerThread->Dispatch(task.forget(), NS_DISPATCH_NORMAL);
   return true;
 }
 
 VideoDecoderManagerParent::VideoDecoderManagerParent(
     VideoDecoderManagerThreadHolder* aHolder)
     : mThreadHolder(aHolder) {
@@ -274,10 +272,9 @@ mozilla::ipc::IPCResult VideoDecoderMana
 mozilla::ipc::IPCResult
 VideoDecoderManagerParent::RecvDeallocateSurfaceDescriptorGPUVideo(
     const SurfaceDescriptorGPUVideo& aSD) {
   mImageMap.erase(aSD.handle());
   mTextureMap.erase(aSD.handle());
   return IPC_OK();
 }
 
-}  // namespace dom
 }  // namespace mozilla
--- a/dom/media/ipc/VideoDecoderManagerParent.h
+++ b/dom/media/ipc/VideoDecoderManagerParent.h
@@ -1,20 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef include_dom_ipc_VideoDecoderManagerParent_h
-#define include_dom_ipc_VideoDecoderManagerParent_h
+#ifndef include_ipc_VideoDecoderManagerParent_h
+#define include_ipc_VideoDecoderManagerParent_h
 
-#include "mozilla/dom/PVideoDecoderManagerParent.h"
+#include "mozilla/PVideoDecoderManagerParent.h"
 
 namespace mozilla {
-namespace dom {
 
 class VideoDecoderManagerThreadHolder;
 
 class VideoDecoderManagerParent final : public PVideoDecoderManagerParent {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderManagerParent)
 
   static bool CreateForContent(
@@ -57,12 +56,11 @@ class VideoDecoderManagerParent final : 
   void Open(Endpoint<PVideoDecoderManagerParent>&& aEndpoint);
 
   std::map<uint64_t, RefPtr<layers::Image>> mImageMap;
   std::map<uint64_t, RefPtr<layers::TextureClient>> mTextureMap;
 
   RefPtr<VideoDecoderManagerThreadHolder> mThreadHolder;
 };
 
-}  // namespace dom
 }  // namespace mozilla
 
 #endif  // include_dom_ipc_VideoDecoderManagerParent_h
--- a/dom/media/ipc/VideoDecoderParent.cpp
+++ b/dom/media/ipc/VideoDecoderParent.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/layers/ImageClient.h"
 #include "MediaInfo.h"
 #include "VideoDecoderManagerParent.h"
 #ifdef XP_WIN
 #include "WMFDecoderModule.h"
 #endif
 
 namespace mozilla {
-namespace dom {
 
 using base::Thread;
 using media::TimeUnit;
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 class KnowsCompositorVideo : public layers::KnowsCompositor {
@@ -275,10 +274,9 @@ void VideoDecoderParent::Error(const Med
     Unused << SendError(aError);
   }
 }
 
 bool VideoDecoderParent::OnManagerThread() {
   return mParent->OnManagerThread();
 }
 
-}  // namespace dom
 }  // namespace mozilla
--- a/dom/media/ipc/VideoDecoderParent.h
+++ b/dom/media/ipc/VideoDecoderParent.h
@@ -1,26 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef include_dom_ipc_VideoDecoderParent_h
-#define include_dom_ipc_VideoDecoderParent_h
+#ifndef include_ipc_VideoDecoderParent_h
+#define include_ipc_VideoDecoderParent_h
 
 #include "ImageContainer.h"
 #include "MediaData.h"
 #include "PlatformDecoderModule.h"
 #include "VideoDecoderManagerParent.h"
 #include "mozilla/MozPromise.h"
-#include "mozilla/dom/PVideoDecoderParent.h"
+#include "mozilla/PVideoDecoderParent.h"
 #include "mozilla/layers/TextureForwarder.h"
 
 namespace mozilla {
-namespace dom {
 
 class KnowsCompositorVideo;
 
 class VideoDecoderParent final : public PVideoDecoderParent {
  public:
   // We refcount this class since the task queue can have runnables
   // that reference us.
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderParent)
@@ -57,12 +56,11 @@ class VideoDecoderParent final : public 
   RefPtr<TaskQueue> mDecodeTaskQueue;
   RefPtr<MediaDataDecoder> mDecoder;
   RefPtr<KnowsCompositorVideo> mKnowsCompositor;
 
   // Can only be accessed from the manager thread
   bool mDestroyed;
 };
 
-}  // namespace dom
 }  // namespace mozilla
 
-#endif  // include_dom_ipc_VideoDecoderParent_h
+#endif  // include_ipc_VideoDecoderParent_h
--- a/dom/media/ipc/moz.build
+++ b/dom/media/ipc/moz.build
@@ -20,22 +20,22 @@ EXPORTS.mozilla += [
     'RDDParent.h',
     'RDDProcessHost.h',
     'RDDProcessImpl.h',
     'RDDProcessManager.h',
     'RemoteDecoderManagerChild.h',
     'RemoteDecoderManagerParent.h',
     'RemoteDecoderModule.h',
     'RemoteMediaDataDecoder.h',
+    'VideoDecoderManagerChild.h',
+    'VideoDecoderManagerParent.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'MediaIPCUtils.h',
-    'VideoDecoderManagerChild.h',
-    'VideoDecoderManagerParent.h',
 ]
 
 SOURCES += [
     'GpuDecoderModule.cpp',
     'RDDChild.cpp',
     'RDDParent.cpp',
     'RDDProcessHost.cpp',
     'RDDProcessImpl.cpp',
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -12,19 +12,19 @@
 #include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "GLContextProvider.h"
 #include "GPUProcessHost.h"
 #include "GPUProcessManager.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
+#include "mozilla/VideoDecoderManagerChild.h"
+#include "mozilla/VideoDecoderManagerParent.h"
 #include "mozilla/dom/MemoryReportRequest.h"
-#include "mozilla/dom/VideoDecoderManagerChild.h"
-#include "mozilla/dom/VideoDecoderManagerParent.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/image/ImageMemoryReporter.h"
 #include "mozilla/ipc/CrashReporterClient.h"
 #include "mozilla/ipc/ProcessChild.h"
 #include "mozilla/layers/APZInputBridgeParent.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "mozilla/layers/APZUtils.h"  // for apz::InitializeGlobalState
@@ -392,17 +392,17 @@ mozilla::ipc::IPCResult GPUParent::RecvN
   if (!VRManagerParent::CreateForContent(std::move(aEndpoint))) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUParent::RecvNewContentVideoDecoderManager(
     Endpoint<PVideoDecoderManagerParent>&& aEndpoint) {
-  if (!dom::VideoDecoderManagerParent::CreateForContent(std::move(aEndpoint))) {
+  if (!VideoDecoderManagerParent::CreateForContent(std::move(aEndpoint))) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUParent::RecvAddLayerTreeIdMapping(
     const LayerTreeIdMapping& aMapping) {
   LayerTreeOwnerTracker::Get()->Map(aMapping.layersId(), aMapping.ownerId());
@@ -480,17 +480,17 @@ void GPUParent::ActorDestroy(ActorDestro
     mProfilerController = nullptr;
   }
 #endif
 
   if (mVsyncBridge) {
     mVsyncBridge->Shutdown();
     mVsyncBridge = nullptr;
   }
-  dom::VideoDecoderManagerParent::ShutdownVideoBridge();
+  VideoDecoderManagerParent::ShutdownVideoBridge();
   CompositorThreadHolder::Shutdown();
   // There is a case that RenderThread exists when gfxVars::UseWebRender() is
   // false. This could happen when WebRender was fallbacked to compositor.
   if (wr::RenderThread::Get()) {
     wr::RenderThread::ShutDown();
   }
 
   image::ImageMemoryReporter::ShutdownForWebRender();
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -8,16 +8,18 @@
 
 #include "gfxPrefs.h"
 #include "GPUProcessHost.h"
 #include "GPUProcessListener.h"
 #include "mozilla/MemoryReportingProcess.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/StaticPrefs.h"
+#include "mozilla/VideoDecoderManagerChild.h"
+#include "mozilla/VideoDecoderManagerParent.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/layers/APZCTreeManagerChild.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/layers/CompositorManagerChild.h"
 #include "mozilla/layers/CompositorManagerParent.h"
 #include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/layers/ImageBridgeChild.h"
@@ -32,18 +34,16 @@
 #endif
 #include "nsBaseWidget.h"
 #include "nsContentUtils.h"
 #include "VRManagerChild.h"
 #include "VRManagerParent.h"
 #include "VsyncBridgeChild.h"
 #include "VsyncIOThreadHolder.h"
 #include "VsyncSource.h"
-#include "mozilla/dom/VideoDecoderManagerChild.h"
-#include "mozilla/dom/VideoDecoderManagerParent.h"
 #include "nsExceptionHandler.h"
 #include "nsPrintfCString.h"
 
 #if defined(MOZ_WIDGET_ANDROID)
 #include "mozilla/widget/AndroidUiThread.h"
 #include "mozilla/layers/UiCompositorControllerChild.h"
 #endif  // defined(MOZ_WIDGET_ANDROID)
 
@@ -762,17 +762,17 @@ RefPtr<CompositorSession> GPUProcessMana
 #endif
 }
 
 bool GPUProcessManager::CreateContentBridges(
     base::ProcessId aOtherProcess,
     ipc::Endpoint<PCompositorManagerChild>* aOutCompositor,
     ipc::Endpoint<PImageBridgeChild>* aOutImageBridge,
     ipc::Endpoint<PVRManagerChild>* aOutVRBridge,
-    ipc::Endpoint<dom::PVideoDecoderManagerChild>* aOutVideoManager,
+    ipc::Endpoint<PVideoDecoderManagerChild>* aOutVideoManager,
     nsTArray<uint32_t>* aNamespaces) {
   if (!CreateContentCompositorManager(aOtherProcess, aOutCompositor) ||
       !CreateContentImageBridge(aOtherProcess, aOutImageBridge) ||
       !CreateContentVRManager(aOtherProcess, aOutVRBridge)) {
     return false;
   }
   // VideoDeocderManager is only supported in the GPU process, so we allow this
   // to be fallible.
@@ -874,26 +874,26 @@ bool GPUProcessManager::CreateContentVRM
   }
 
   *aOutEndpoint = std::move(childPipe);
   return true;
 }
 
 void GPUProcessManager::CreateContentVideoDecoderManager(
     base::ProcessId aOtherProcess,
-    ipc::Endpoint<dom::PVideoDecoderManagerChild>* aOutEndpoint) {
+    ipc::Endpoint<PVideoDecoderManagerChild>* aOutEndpoint) {
   if (!EnsureGPUReady() || !StaticPrefs::MediaGpuProcessDecoder() ||
       !mDecodeVideoOnGpuProcess) {
     return;
   }
 
-  ipc::Endpoint<dom::PVideoDecoderManagerParent> parentPipe;
-  ipc::Endpoint<dom::PVideoDecoderManagerChild> childPipe;
+  ipc::Endpoint<PVideoDecoderManagerParent> parentPipe;
+  ipc::Endpoint<PVideoDecoderManagerChild> childPipe;
 
-  nsresult rv = dom::PVideoDecoderManager::CreateEndpoints(
+  nsresult rv = PVideoDecoderManager::CreateEndpoints(
       mGPUChild->OtherPid(), aOtherProcess, &parentPipe, &childPipe);
   if (NS_FAILED(rv)) {
     gfxCriticalNote << "Could not create content video decoder: "
                     << hexa(int(rv));
     return;
   }
 
   mGPUChild->SendNewContentVideoDecoderManager(std::move(parentPipe));
--- a/gfx/ipc/GPUProcessManager.h
+++ b/gfx/ipc/GPUProcessManager.h
@@ -19,16 +19,17 @@
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 #include "nsIObserverService.h"
 #include "nsThreadUtils.h"
 class nsBaseWidget;
 
 namespace mozilla {
 class MemoryReportingProcess;
+class PVideoDecoderManagerChild;
 namespace layers {
 class IAPZCTreeManager;
 class CompositorOptions;
 class CompositorSession;
 class CompositorUpdateObserver;
 class PCompositorBridgeChild;
 class PCompositorManagerChild;
 class PImageBridgeChild;
@@ -37,17 +38,16 @@ class InProcessCompositorSession;
 class UiCompositorControllerChild;
 }  // namespace layers
 namespace widget {
 class CompositorWidget;
 }  // namespace widget
 namespace dom {
 class ContentParent;
 class TabParent;
-class PVideoDecoderManagerChild;
 }  // namespace dom
 namespace ipc {
 class GeckoChildProcessHost;
 }  // namespace ipc
 namespace gfx {
 
 class GPUChild;
 class GPUProcessListener;
@@ -96,17 +96,17 @@ class GPUProcessManager final : public G
       bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize,
       bool* aRetry);
 
   bool CreateContentBridges(
       base::ProcessId aOtherProcess,
       mozilla::ipc::Endpoint<PCompositorManagerChild>* aOutCompositor,
       mozilla::ipc::Endpoint<PImageBridgeChild>* aOutImageBridge,
       mozilla::ipc::Endpoint<PVRManagerChild>* aOutVRBridge,
-      mozilla::ipc::Endpoint<dom::PVideoDecoderManagerChild>* aOutVideoManager,
+      mozilla::ipc::Endpoint<PVideoDecoderManagerChild>* aOutVideoManager,
       nsTArray<uint32_t>* aNamespaces);
 
   // Maps the layer tree and process together so that aOwningPID is allowed
   // to access aLayersId across process.
   void MapLayerTreeId(LayersId aLayersId, base::ProcessId aOwningId);
 
   // Release compositor-thread resources referred to by |aID|.
   //
@@ -186,17 +186,17 @@ class GPUProcessManager final : public G
   bool CreateContentImageBridge(
       base::ProcessId aOtherProcess,
       mozilla::ipc::Endpoint<PImageBridgeChild>* aOutEndpoint);
   bool CreateContentVRManager(
       base::ProcessId aOtherProcess,
       mozilla::ipc::Endpoint<PVRManagerChild>* aOutEndpoint);
   void CreateContentVideoDecoderManager(
       base::ProcessId aOtherProcess,
-      mozilla::ipc::Endpoint<dom::PVideoDecoderManagerChild>* aOutEndPoint);
+      mozilla::ipc::Endpoint<PVideoDecoderManagerChild>* aOutEndPoint);
 
   // Called from RemoteCompositorSession. We track remote sessions so we can
   // notify their owning widgets that the session must be restarted.
   void RegisterRemoteProcessSession(RemoteCompositorSession* aSession);
   void UnregisterRemoteProcessSession(RemoteCompositorSession* aSession);
 
   // Called from InProcessCompositorSession. We track in process sessino so we
   // can notify their owning widgets that the session must be restarted
--- a/gfx/layers/GPUVideoImage.h
+++ b/gfx/layers/GPUVideoImage.h
@@ -23,17 +23,17 @@ class GLBlitHelper;
 namespace layers {
 
 // Image class that refers to a decoded video frame within
 // the GPU process.
 class GPUVideoImage final : public Image {
   friend class gl::GLBlitHelper;
 
  public:
-  GPUVideoImage(dom::VideoDecoderManagerChild* aManager,
+  GPUVideoImage(VideoDecoderManagerChild* aManager,
                 const SurfaceDescriptorGPUVideo& aSD, const gfx::IntSize& aSize)
       : Image(nullptr, ImageFormat::GPU_VIDEO), mSize(aSize) {
     // Create the TextureClient immediately since the GPUVideoTextureData
     // is responsible for deallocating the SurfaceDescriptor.
     //
     // Use the RECYCLE texture flag, since it's likely that our 'real'
     // TextureData (in the decoder thread of the GPU process) is using
     // it too, and we want to make sure we don't send the delete message
--- a/gfx/layers/client/GPUVideoTextureClient.cpp
+++ b/gfx/layers/client/GPUVideoTextureClient.cpp
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GPUVideoTextureClient.h"
-#include "mozilla/dom/VideoDecoderManagerChild.h"
+#include "mozilla/VideoDecoderManagerChild.h"
 #include "mozilla/gfx/2D.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace gfx;
 
-GPUVideoTextureData::GPUVideoTextureData(
-    dom::VideoDecoderManagerChild* aManager,
-    const SurfaceDescriptorGPUVideo& aSD, const gfx::IntSize& aSize)
+GPUVideoTextureData::GPUVideoTextureData(VideoDecoderManagerChild* aManager,
+                                         const SurfaceDescriptorGPUVideo& aSD,
+                                         const gfx::IntSize& aSize)
     : mManager(aManager), mSD(aSD), mSize(aSize) {}
 
 GPUVideoTextureData::~GPUVideoTextureData() {}
 
 bool GPUVideoTextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
   aOutDescriptor = mSD;
   return true;
 }
--- a/gfx/layers/client/GPUVideoTextureClient.h
+++ b/gfx/layers/client/GPUVideoTextureClient.h
@@ -8,24 +8,23 @@
 #define MOZILLA_GFX_GPUVIDEOTEXTURECLIENT_H
 
 #include "mozilla/layers/TextureClient.h"
 
 namespace mozilla {
 namespace gfx {
 class SourceSurface;
 }
-namespace dom {
 class VideoDecoderManagerChild;
-}
+
 namespace layers {
 
 class GPUVideoTextureData : public TextureData {
  public:
-  GPUVideoTextureData(dom::VideoDecoderManagerChild* aManager,
+  GPUVideoTextureData(VideoDecoderManagerChild* aManager,
                       const SurfaceDescriptorGPUVideo& aSD,
                       const gfx::IntSize& aSize);
   ~GPUVideoTextureData();
 
   virtual void FillInfo(TextureData::Info& aInfo) const override;
 
   virtual bool Lock(OpenMode) override { return true; };
 
@@ -37,17 +36,17 @@ class GPUVideoTextureData : public Textu
 
   virtual void Forget(LayersIPCChannel* aAllocator) override;
 
   already_AddRefed<gfx::SourceSurface> GetAsSourceSurface();
 
   virtual GPUVideoTextureData* AsGPUVideoTextureData() override { return this; }
 
  protected:
-  RefPtr<dom::VideoDecoderManagerChild> mManager;
+  RefPtr<VideoDecoderManagerChild> mManager;
   SurfaceDescriptorGPUVideo mSD;
   gfx::IntSize mSize;
 
  public:
   const decltype(mSD)& SD() const { return mSD; }
 };
 
 }  // namespace layers
--- a/gfx/layers/composite/GPUVideoTextureHost.cpp
+++ b/gfx/layers/composite/GPUVideoTextureHost.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GPUVideoTextureHost.h"
-#include "mozilla/dom/VideoDecoderManagerParent.h"
+#include "mozilla/VideoDecoderManagerParent.h"
 #include "ImageContainer.h"
 #include "mozilla/layers/VideoBridgeParent.h"
 
 namespace mozilla {
 namespace layers {
 
 GPUVideoTextureHost::GPUVideoTextureHost(TextureFlags aFlags,
                                          TextureHost* aWrappedTextureHost)
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -5,29 +5,29 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 
 #include "mozilla/Atomics.h"
 #include "mozilla/Poison.h"
 #include "mozilla/RemoteDecoderManagerChild.h"
 #include "mozilla/SharedThreadPool.h"
+#include "mozilla/VideoDecoderManagerChild.h"
 #include "mozilla/XPCOM.h"
 #include "nsXULAppAPI.h"
 
 #ifndef ANDROID
 #include "nsTerminator.h"
 #endif
 
 #include "nsXPCOMPrivate.h"
 #include "nsXPCOMCIDInternal.h"
 
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
-#include "mozilla/dom/VideoDecoderManagerChild.h"
 
 #include "prlink.h"
 
 #include "nsCycleCollector.h"
 #include "nsObserverList.h"
 #include "nsObserverService.h"
 #include "nsScriptableInputStream.h"
 #include "nsBinaryStream.h"
@@ -810,17 +810,17 @@ nsresult ShutdownXPCOM(nsIServiceManager
       mozilla::XPCOMShutdownNotified();
 #endif
     }
 
     // This must happen after the shutdown of media and widgets, which
     // are triggered by the NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
     NS_ProcessPendingEvents(thread);
     gfxPlatform::ShutdownLayersIPC();
-    mozilla::dom::VideoDecoderManagerChild::Shutdown();
+    mozilla::VideoDecoderManagerChild::Shutdown();
     mozilla::RemoteDecoderManagerChild::Shutdown();
 
     mozilla::scache::StartupCache::DeleteSingleton();
     if (observerService) {
       mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownThreads);
       observerService->NotifyObservers(
           nullptr, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID, nullptr);
     }