Backed out changeset 5bb547481faf (bug 1451973) for testChild failures on a CLOSED TREE
authorGurzau Raul <rgurzau@mozilla.com>
Fri, 25 May 2018 14:16:34 +0300
changeset 419882 b479a3309609c69098ab05bf46e0e6c0b04d2a4e
parent 419881 4c4a74e7bdfd99a091d0f29498dae6d0f0213466
child 419883 f1901407d4fae48934787c62dcb699f75ad0c60d
push id34052
push userccoroiu@mozilla.com
push dateFri, 25 May 2018 17:52:14 +0000
treeherdermozilla-central@94d7f0e1c4d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1451973
milestone62.0a1
backs out5bb547481fafdc098c8a611aff9765b41e91468d
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
Backed out changeset 5bb547481faf (bug 1451973) for testChild failures on a CLOSED TREE
dom/base/ChromeMessageBroadcaster.cpp
dom/base/ChromeMessageBroadcaster.h
dom/base/ChromeMessageSender.cpp
dom/base/ChromeMessageSender.h
dom/base/DocumentOrShadowRoot.h
dom/base/MessageBroadcaster.cpp
dom/base/MessageBroadcaster.h
dom/base/MessageListenerManager.cpp
dom/base/MessageListenerManager.h
dom/base/MessageManagerGlobal.h
dom/base/MessageSender.h
dom/base/MozQueryInterface.h
dom/base/NameSpaceConstants.h
dom/base/ParentProcessMessageManager.cpp
dom/base/ParentProcessMessageManager.h
dom/base/ProcessMessageManager.cpp
dom/base/ProcessMessageManager.h
dom/base/ShadowRoot.cpp
dom/base/StyleSheetList.cpp
dom/base/moz.build
dom/base/nsCCUncollectableMarker.cpp
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsDOMMutationObserver.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/base/nsFrameMessageManager.cpp
dom/base/nsFrameMessageManager.h
dom/base/nsIdentifierMapEntry.h
dom/chrome-webidl/MessageManager.webidl
dom/ipc/ContentBridgeParent.cpp
dom/ipc/ContentParent.cpp
dom/ipc/nsIContentParent.cpp
dom/ipc/nsIContentParent.h
layout/style/nsComputedDOMStyle.h
--- a/dom/base/ChromeMessageBroadcaster.cpp
+++ b/dom/base/ChromeMessageBroadcaster.cpp
@@ -2,24 +2,70 @@
 /* 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 "mozilla/dom/ChromeMessageBroadcaster.h"
 #include "AccessCheck.h"
 #include "mozilla/HoldDropJSObjects.h"
+#include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 
 namespace mozilla {
 namespace dom {
 
+ChromeMessageBroadcaster::ChromeMessageBroadcaster(ChromeMessageBroadcaster* aParentManager,
+                                                   MessageManagerFlags aFlags)
+  : MessageListenerManager(nullptr, aParentManager,
+                           aFlags |
+                           MessageManagerFlags::MM_BROADCASTER |
+                           MessageManagerFlags::MM_CHROME)
+{
+  if (mIsProcessManager) {
+    mozilla::HoldJSObjects(this);
+  }
+  if (aParentManager) {
+    aParentManager->AddChildManager(this);
+  }
+}
+
+ChromeMessageBroadcaster::~ChromeMessageBroadcaster()
+{
+  if (mIsProcessManager) {
+    mozilla::DropJSObjects(this);
+  }
+}
+
 JSObject*
 ChromeMessageBroadcaster::WrapObject(JSContext* aCx,
                                      JS::Handle<JSObject*> aGivenProto)
 {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ChromeMessageBroadcasterBinding::Wrap(aCx, this, aGivenProto);
 }
 
+void
+ChromeMessageBroadcaster::ReleaseCachedProcesses()
+{
+  ContentParent::ReleaseCachedProcesses();
+}
+
+void
+ChromeMessageBroadcaster::AddChildManager(MessageListenerManager* aManager)
+{
+  mChildManagers.AppendElement(aManager);
+
+  RefPtr<nsFrameMessageManager> kungfuDeathGrip = this;
+  RefPtr<nsFrameMessageManager> kungfuDeathGrip2 = aManager;
+
+  LoadPendingScripts(this, aManager);
+}
+
+void
+ChromeMessageBroadcaster::RemoveChildManager(MessageListenerManager* aManager)
+{
+  mChildManagers.RemoveElement(aManager);
+}
+
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/ChromeMessageBroadcaster.h
+++ b/dom/base/ChromeMessageBroadcaster.h
@@ -2,41 +2,84 @@
 /* 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 mozilla_dom_ChromeMessageBroadcaster_h
 #define mozilla_dom_ChromeMessageBroadcaster_h
 
-#include "mozilla/dom/MessageBroadcaster.h"
+#include "mozilla/dom/MessageListenerManager.h"
 
 namespace mozilla {
 namespace dom {
 
-/**
- * Implementation for the WebIDL ChromeMessageBroadcaster interface. Used for window and
- * group message managers.
- */
-class ChromeMessageBroadcaster final : public MessageBroadcaster
+class ChromeMessageBroadcaster final : public MessageListenerManager
 {
 public:
   explicit ChromeMessageBroadcaster(MessageManagerFlags aFlags)
     : ChromeMessageBroadcaster(nullptr, aFlags)
   {
     MOZ_ASSERT(!(aFlags & ~(MessageManagerFlags::MM_GLOBAL |
+                            MessageManagerFlags::MM_PROCESSMANAGER |
                             MessageManagerFlags::MM_OWNSCALLBACK)));
   }
-  explicit ChromeMessageBroadcaster(MessageBroadcaster* aParentManager)
+  explicit ChromeMessageBroadcaster(ChromeMessageBroadcaster* aParentManager)
     : ChromeMessageBroadcaster(aParentManager, MessageManagerFlags::MM_NONE)
   {}
 
+  static ChromeMessageBroadcaster* From(nsFrameMessageManager* aManager)
+  {
+    if (aManager->IsBroadcaster() && aManager->IsChrome()) {
+      return static_cast<ChromeMessageBroadcaster*>(aManager);
+    }
+    return nullptr;
+  }
+
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
+  void BroadcastAsyncMessage(JSContext* aCx, const nsAString& aMessageName,
+                             JS::Handle<JS::Value> aObj,
+                             JS::Handle<JSObject*> aObjects,
+                             mozilla::ErrorResult& aError)
+  {
+    DispatchAsyncMessage(aCx, aMessageName, aObj, aObjects, nullptr,
+                         JS::UndefinedHandleValue, aError);
+  }
+  uint32_t ChildCount()
+  {
+    return mChildManagers.Length();
+  }
+  MessageListenerManager* GetChildAt(uint32_t aIndex)
+  {
+    return mChildManagers.SafeElementAt(aIndex);
+  }
+  void ReleaseCachedProcesses();
+
+  // ProcessScriptLoader
+  void LoadProcessScript(const nsAString& aUrl, bool aAllowDelayedLoad,
+                         mozilla::ErrorResult& aError)
+  {
+    LoadScript(aUrl, aAllowDelayedLoad, false, aError);
+  }
+  void RemoveDelayedProcessScript(const nsAString& aURL)
+  {
+    RemoveDelayedScript(aURL);
+  }
+  void GetDelayedProcessScripts(JSContext* aCx,
+                                nsTArray<nsTArray<JS::Value>>& aScripts,
+                                mozilla::ErrorResult& aError)
+  {
+    GetDelayedScripts(aCx, aScripts, aError);
+  }
+
+  // GlobalProcessScriptLoader
+  using nsFrameMessageManager::GetInitialProcessData;
+
   // FrameScriptLoader
   void LoadFrameScript(const nsAString& aUrl, bool aAllowDelayedLoad,
                        bool aRunInGlobalScope, mozilla::ErrorResult& aError)
   {
     LoadScript(aUrl, aAllowDelayedLoad, aRunInGlobalScope, aError);
   }
   void RemoveDelayedFrameScript(const nsAString& aURL)
   {
@@ -44,22 +87,21 @@ public:
   }
   void GetDelayedFrameScripts(JSContext* aCx,
                               nsTArray<nsTArray<JS::Value>>& aScripts,
                               mozilla::ErrorResult& aError)
   {
     GetDelayedScripts(aCx, aScripts, aError);
   }
 
+  void AddChildManager(MessageListenerManager* aManager);
+  void RemoveChildManager(MessageListenerManager* aManager);
+
 private:
-  ChromeMessageBroadcaster(MessageBroadcaster* aParentManager,
-                           MessageManagerFlags aFlags)
-    : MessageBroadcaster(aParentManager,
-                         aFlags |
-                         MessageManagerFlags::MM_BROADCASTER |
-                         MessageManagerFlags::MM_CHROME)
-  {}
+  ChromeMessageBroadcaster(ChromeMessageBroadcaster* aParentManager,
+                           MessageManagerFlags aFlags);
+  virtual ~ChromeMessageBroadcaster();
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_ChromeMessageBroadcaster_h
--- a/dom/base/ChromeMessageSender.cpp
+++ b/dom/base/ChromeMessageSender.cpp
@@ -5,16 +5,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 
 namespace mozilla {
 namespace dom {
 
+ChromeMessageSender::ChromeMessageSender(ipc::MessageManagerCallback* aCallback,
+                                         ChromeMessageBroadcaster* aParentManager,
+                                         MessageManagerFlags aFlags)
+  : MessageSender(aCallback, aParentManager, aFlags | MessageManagerFlags::MM_CHROME)
+{
+  MOZ_ASSERT(!(aFlags & ~(MessageManagerFlags::MM_GLOBAL |
+                          MessageManagerFlags::MM_PROCESSMANAGER |
+                          MessageManagerFlags::MM_OWNSCALLBACK)));
+
+  // This is a bit hackish. We attach to the parent, but only if we have a callback. We
+  // don't have a callback for the frame message manager, and for parent process message
+  // managers (except the parent in-process message manager). In those cases we wait until
+  // the child process is running (see MessageSender::InitWithCallback).
+  if (aParentManager && mCallback) {
+    aParentManager->AddChildManager(this);
+  }
+}
+
 JSObject*
 ChromeMessageSender::WrapObject(JSContext* aCx,
                                 JS::Handle<JSObject*> aGivenProto)
 {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ChromeMessageSenderBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/ChromeMessageSender.h
+++ b/dom/base/ChromeMessageSender.h
@@ -7,31 +7,45 @@
 #ifndef mozilla_dom_ChromeMessageSender_h
 #define mozilla_dom_ChromeMessageSender_h
 
 #include "mozilla/dom/MessageSender.h"
 
 namespace mozilla {
 namespace dom {
 
-class MessageBroadcaster;
+class ChromeMessageBroadcaster;
 
 class ChromeMessageSender final : public MessageSender
 {
 public:
-  explicit ChromeMessageSender(MessageBroadcaster* aParentManager)
-    : MessageSender(nullptr, aParentManager, MessageManagerFlags::MM_CHROME)
-  {
-    // This is a bit hackish, we wait until the child process is running before attaching
-    // to the parent manager (see MessageSender::InitWithCallback).
-  }
+  ChromeMessageSender(ipc::MessageManagerCallback* aCallback,
+                      ChromeMessageBroadcaster* aParentManager,
+                      MessageManagerFlags aFlags=MessageManagerFlags::MM_NONE);
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
+  // ProcessScriptLoader
+  void LoadProcessScript(const nsAString& aUrl, bool aAllowDelayedLoad,
+                         mozilla::ErrorResult& aError)
+  {
+    LoadScript(aUrl, aAllowDelayedLoad, false, aError);
+  }
+  void RemoveDelayedProcessScript(const nsAString& aURL)
+  {
+    RemoveDelayedScript(aURL);
+  }
+  void GetDelayedProcessScripts(JSContext* aCx,
+                                nsTArray<nsTArray<JS::Value>>& aScripts,
+                                mozilla::ErrorResult& aError)
+  {
+    GetDelayedScripts(aCx, aScripts, aError);
+  }
+
   // FrameScriptLoader
   void LoadFrameScript(const nsAString& aUrl, bool aAllowDelayedLoad,
                        bool aRunInGlobalScope, mozilla::ErrorResult& aError)
   {
     LoadScript(aUrl, aAllowDelayedLoad, aRunInGlobalScope, aError);
   }
   void RemoveDelayedFrameScript(const nsAString& aURL)
   {
--- a/dom/base/DocumentOrShadowRoot.h
+++ b/dom/base/DocumentOrShadowRoot.h
@@ -8,25 +8,23 @@
 #define mozilla_dom_DocumentOrShadowRoot_h__
 
 #include "mozilla/dom/NameSpaceConstants.h"
 #include "nsContentListDeclarations.h"
 #include "nsTArray.h"
 #include "nsIdentifierMapEntry.h"
 
 class nsContentList;
-class nsIDocument;
 class nsINode;
 
 namespace mozilla {
 class StyleSheet;
 
 namespace dom {
 
-class Element;
 class StyleSheetList;
 class ShadowRoot;
 
 /**
  * A class meant to be shared by ShadowRoot and Document, that holds a list of
  * stylesheets.
  *
  * TODO(emilio, bug 1418159): In the future this should hold most of the
deleted file mode 100644
--- a/dom/base/MessageBroadcaster.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- 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 "mozilla/dom/MessageBroadcaster.h"
-#include "mozilla/dom/ContentParent.h"
-
-namespace mozilla {
-namespace dom {
-
-MessageBroadcaster::MessageBroadcaster(MessageBroadcaster* aParentManager,
-                                       MessageManagerFlags aFlags)
-  : MessageListenerManager(nullptr, aParentManager,
-                           aFlags |
-                           MessageManagerFlags::MM_BROADCASTER)
-{
-  if (aParentManager) {
-    aParentManager->AddChildManager(this);
-  }
-}
-
-void
-MessageBroadcaster::ReleaseCachedProcesses()
-{
-  ContentParent::ReleaseCachedProcesses();
-}
-
-void
-MessageBroadcaster::AddChildManager(MessageListenerManager* aManager)
-{
-  mChildManagers.AppendElement(aManager);
-
-  RefPtr<nsFrameMessageManager> kungfuDeathGrip = this;
-  RefPtr<nsFrameMessageManager> kungfuDeathGrip2 = aManager;
-
-  LoadPendingScripts(this, aManager);
-}
-
-void
-MessageBroadcaster::RemoveChildManager(MessageListenerManager* aManager)
-{
-  mChildManagers.RemoveElement(aManager);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/base/MessageBroadcaster.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- 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 mozilla_dom_MessageBroadcaster_h
-#define mozilla_dom_MessageBroadcaster_h
-
-#include "mozilla/dom/MessageListenerManager.h"
-
-namespace mozilla {
-namespace dom {
-
-/**
- * Implementation for the WebIDL MessageBroadcaster interface. Base class for window and
- * process broadcaster message managers.
- */
-class MessageBroadcaster : public MessageListenerManager
-{
-public:
-  static MessageBroadcaster* From(MessageListenerManager* aManager)
-  {
-    if (aManager->IsBroadcaster()) {
-      return static_cast<MessageBroadcaster*>(aManager);
-    }
-    return nullptr;
-  }
-
-  void BroadcastAsyncMessage(JSContext* aCx, const nsAString& aMessageName,
-                             JS::Handle<JS::Value> aObj,
-                             JS::Handle<JSObject*> aObjects,
-                             mozilla::ErrorResult& aError)
-  {
-    DispatchAsyncMessage(aCx, aMessageName, aObj, aObjects, nullptr,
-                         JS::UndefinedHandleValue, aError);
-  }
-  uint32_t ChildCount()
-  {
-    return mChildManagers.Length();
-  }
-  MessageListenerManager* GetChildAt(uint32_t aIndex)
-  {
-    return mChildManagers.SafeElementAt(aIndex);
-  }
-  void ReleaseCachedProcesses();
-
-  void AddChildManager(MessageListenerManager* aManager);
-  void RemoveChildManager(MessageListenerManager* aManager);
-
-protected:
-  MessageBroadcaster(MessageBroadcaster* aParentManager, MessageManagerFlags aFlags);
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_MessageBroadcaster_h
--- a/dom/base/MessageListenerManager.cpp
+++ b/dom/base/MessageListenerManager.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/MessageListenerManager.h"
 
 namespace mozilla {
 namespace dom {
 
 MessageListenerManager::MessageListenerManager(ipc::MessageManagerCallback* aCallback,
-                                               MessageBroadcaster* aParentManager,
+                                               ChromeMessageBroadcaster* aParentManager,
                                                ipc::MessageManagerFlags aFlags)
   : nsFrameMessageManager(aCallback, aFlags),
     mParentManager(aParentManager)
 {
 }
 
 MessageListenerManager::~MessageListenerManager()
 {
--- a/dom/base/MessageListenerManager.h
+++ b/dom/base/MessageListenerManager.h
@@ -9,51 +9,45 @@
 
 #include "nsCycleCollectionNoteChild.h"
 #include "nsFrameMessageManager.h"
 #include "nsWrapperCache.h"
 
 namespace mozilla {
 namespace dom {
 
-class MessageBroadcaster;
-
-/**
- * Implementation for the WebIDL MessageListenerManager interface. Base class for message
- * managers that are exposed to script.
- */
 class MessageListenerManager : public nsFrameMessageManager,
                                public nsWrapperCache
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageListenerManager,
                                                          nsFrameMessageManager)
 
-  MessageBroadcaster* GetParentObject()
+  ChromeMessageBroadcaster* GetParentObject()
   {
     return mParentManager;
   }
 
-  virtual MessageBroadcaster* GetParentManager() override
+  virtual ChromeMessageBroadcaster* GetParentManager() override
   {
     return mParentManager;
   }
 
   /**
    * If aRemove is true then RemoveChildManager(this) will be called on the parent manager
    * first.
    */
   virtual void ClearParentManager(bool aRemove) override;
 
 protected:
   MessageListenerManager(ipc::MessageManagerCallback* aCallback,
-                         MessageBroadcaster* aParentManager,
+                         ChromeMessageBroadcaster* aParentManager,
                          MessageManagerFlags aFlags);
   virtual ~MessageListenerManager();
 
-  RefPtr<MessageBroadcaster> mParentManager;
+  RefPtr<ChromeMessageBroadcaster> mParentManager;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_MessageListenerManager_h
--- a/dom/base/MessageManagerGlobal.h
+++ b/dom/base/MessageManagerGlobal.h
@@ -73,17 +73,17 @@ public:
   {
     if (!mMessageManager) {
       aError.Throw(NS_ERROR_NULL_POINTER);
       return;
     }
     mMessageManager->SendAsyncMessage(aCx, aMessageName, aObj, aObjects,
                                       aPrincipal, aTransfers, aError);
   }
-  already_AddRefed<ProcessMessageManager> GetProcessMessageManager(mozilla::ErrorResult& aError)
+  already_AddRefed<ChromeMessageSender> GetProcessMessageManager(mozilla::ErrorResult& aError)
   {
     if (!mMessageManager) {
       aError.Throw(NS_ERROR_NULL_POINTER);
       return nullptr;
     }
     return mMessageManager->GetProcessMessageManager(aError);
   }
 
--- a/dom/base/MessageSender.h
+++ b/dom/base/MessageSender.h
@@ -7,30 +7,24 @@
 #ifndef mozilla_dom_MessageSender_h
 #define mozilla_dom_MessageSender_h
 
 #include "mozilla/dom/MessageListenerManager.h"
 
 namespace mozilla {
 namespace dom {
 
-class MessageBroadcaster;
-
-/**
- * Implementation for the WebIDL MessageSender interface. Base class for frame and child
- * process message managers.
- */
 class MessageSender : public MessageListenerManager
 {
 public:
   void InitWithCallback(ipc::MessageManagerCallback* aCallback);
 
 protected:
   MessageSender(ipc::MessageManagerCallback* aCallback,
-                MessageBroadcaster* aParentManager,
+                ChromeMessageBroadcaster* aParentManager,
                 MessageManagerFlags aFlags)
     : MessageListenerManager(aCallback, aParentManager, aFlags)
   {}
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/base/MozQueryInterface.h
+++ b/dom/base/MozQueryInterface.h
@@ -15,19 +15,18 @@
  * returning its `this` object or throwing depending on the interface it was
  * passed.
  *
  * For native XPConnect callers, we bypass JSAPI entirely, and directly check
  * whether the queried interface is in the interfaces list.
  */
 
 #include "mozilla/dom/BindingDeclarations.h"
-#include "mozilla/dom/NonRefcountedDOMObject.h"
+#include "mozilla/dom/ChromeUtilsBinding.h"
 #include "mozilla/ErrorResult.h"
-#include "nsID.h"
 
 namespace mozilla {
 namespace dom {
 
 class MozQueryInterface final : public NonRefcountedDOMObject
 {
 public:
   explicit MozQueryInterface(nsTArray<nsIID>&& aInterfaces)
--- a/dom/base/NameSpaceConstants.h
+++ b/dom/base/NameSpaceConstants.h
@@ -2,18 +2,16 @@
 /* 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 mozilla_dom_NameSpaceConstants_h__
 #define mozilla_dom_NameSpaceConstants_h__
 
-#include <stdint.h>
-
 #define kNameSpaceID_Unknown -1
 // 0 is special at C++, so use a static const int32_t for
 // kNameSpaceID_None to keep if from being cast to pointers
 // Note that the XBL cache assumes (and asserts) that it can treat a
 // single-byte value higher than kNameSpaceID_LastBuiltin specially.
 static const int32_t kNameSpaceID_None = 0;
 #define kNameSpaceID_XMLNS    1 // not really a namespace, but it needs to play the game
 #define kNameSpaceID_XML      2
deleted file mode 100644
--- a/dom/base/ParentProcessMessageManager.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- 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 "mozilla/dom/ParentProcessMessageManager.h"
-#include "AccessCheck.h"
-#include "mozilla/HoldDropJSObjects.h"
-#include "mozilla/dom/MessageManagerBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-ParentProcessMessageManager::ParentProcessMessageManager()
-  : MessageBroadcaster(nullptr, MessageManagerFlags::MM_PROCESSMANAGER)
-{
-  mozilla::HoldJSObjects(this);
-}
-
-ParentProcessMessageManager::~ParentProcessMessageManager()
-{
-  mozilla::DropJSObjects(this);
-}
-
-JSObject*
-ParentProcessMessageManager::WrapObject(JSContext* aCx,
-                                        JS::Handle<JSObject*> aGivenProto)
-{
-  MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
-
-  return ParentProcessMessageManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/base/ParentProcessMessageManager.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- 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 mozilla_dom_ParentProcessMessageManager_h
-#define mozilla_dom_ParentProcessMessageManager_h
-
-#include "mozilla/dom/MessageBroadcaster.h"
-
-namespace mozilla {
-namespace dom {
-
-/**
- * Implementation for the WebIDL ParentProcessMessageManager interface.
- * ParentProcessMessageManager is used in a parent process to communicate with all the
- * child processes.
- */
-class ParentProcessMessageManager final : public MessageBroadcaster
-{
-public:
-  ParentProcessMessageManager();
-
-  virtual JSObject* WrapObject(JSContext* aCx,
-                               JS::Handle<JSObject*> aGivenProto) override;
-
-  // ProcessScriptLoader
-  void LoadProcessScript(const nsAString& aUrl, bool aAllowDelayedLoad,
-                         mozilla::ErrorResult& aError)
-  {
-    LoadScript(aUrl, aAllowDelayedLoad, false, aError);
-  }
-  void RemoveDelayedProcessScript(const nsAString& aURL)
-  {
-    RemoveDelayedScript(aURL);
-  }
-  void GetDelayedProcessScripts(JSContext* aCx,
-                                nsTArray<nsTArray<JS::Value>>& aScripts,
-                                mozilla::ErrorResult& aError)
-  {
-    GetDelayedScripts(aCx, aScripts, aError);
-  }
-
-  // GlobalProcessScriptLoader
-  using nsFrameMessageManager::GetInitialProcessData;
-
-private:
-  virtual ~ParentProcessMessageManager();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ParentProcessMessageManager_h
deleted file mode 100644
--- a/dom/base/ProcessMessageManager.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- 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 "mozilla/dom/ProcessMessageManager.h"
-#include "mozilla/dom/MessageManagerBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-ProcessMessageManager::ProcessMessageManager(ipc::MessageManagerCallback* aCallback,
-                                             ParentProcessMessageManager* aParentManager,
-                                             MessageManagerFlags aFlags)
-  : MessageSender(aCallback, aParentManager,
-                  aFlags | MessageManagerFlags::MM_CHROME |
-                           MessageManagerFlags::MM_PROCESSMANAGER)
-{
-  MOZ_ASSERT(!(aFlags & ~(MessageManagerFlags::MM_GLOBAL |
-                          MessageManagerFlags::MM_OWNSCALLBACK)));
-
-  // This is a bit hackish. We attach to the parent manager, but only if we have a
-  // callback (which is only for the in-process message manager). For other cases we wait
-  // until the child process is running (see MessageSender::InitWithCallback).
-  if (aParentManager && mCallback) {
-    aParentManager->AddChildManager(this);
-  }
-}
-
-JSObject*
-ProcessMessageManager::WrapObject(JSContext* aCx,
-                                  JS::Handle<JSObject*> aGivenProto)
-{
-  MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
-
-  return ProcessMessageManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/base/ProcessMessageManager.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- 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 mozilla_dom_ProcessMessageManager_h
-#define mozilla_dom_ProcessMessageManager_h
-
-#include "mozilla/dom/MessageSender.h"
-
-namespace mozilla {
-namespace dom {
-
-class ParentProcessMessageManager;
-
-/**
- * ProcessMessageManager is used in a parent process to communicate with a child process
- * (or with the process itself in a single-process scenario).
- */
-class ProcessMessageManager final : public MessageSender
-{
-public:
-  ProcessMessageManager(ipc::MessageManagerCallback* aCallback,
-                        ParentProcessMessageManager* aParentManager,
-                        MessageManagerFlags aFlags=MessageManagerFlags::MM_NONE);
-
-  virtual JSObject* WrapObject(JSContext* aCx,
-                               JS::Handle<JSObject*> aGivenProto) override;
-
-  // ProcessScriptLoader
-  void LoadProcessScript(const nsAString& aUrl, bool aAllowDelayedLoad,
-                         mozilla::ErrorResult& aError)
-  {
-    LoadScript(aUrl, aAllowDelayedLoad, false, aError);
-  }
-  void RemoveDelayedProcessScript(const nsAString& aURL)
-  {
-    RemoveDelayedScript(aURL);
-  }
-  void GetDelayedProcessScripts(JSContext* aCx,
-                                nsTArray<nsTArray<JS::Value>>& aScripts,
-                                mozilla::ErrorResult& aError)
-  {
-    GetDelayedScripts(aCx, aScripts, aError);
-  }
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ProcessMessageManager_h
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -13,17 +13,16 @@
 #include "nsIStyleSheetLinkingElement.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLSlotElement.h"
 #include "nsXBLPrototypeBinding.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/ServoStyleRuleMap.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
-#include "mozilla/dom/StyleSheetList.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(ShadowRoot)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ShadowRoot, DocumentFragment)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)
--- a/dom/base/StyleSheetList.cpp
+++ b/dom/base/StyleSheetList.cpp
@@ -2,17 +2,16 @@
 /* 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 "mozilla/dom/StyleSheetList.h"
 
 #include "mozilla/dom/StyleSheetListBinding.h"
-#include "nsINode.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -185,30 +185,27 @@ EXPORTS.mozilla.dom += [
     'IdleDeadline.h',
     'IdleRequest.h',
     'IDTracker.h',
     'ImageEncoder.h',
     'ImageTracker.h',
     'IntlUtils.h',
     'Link.h',
     'Location.h',
-    'MessageBroadcaster.h',
     'MessageListenerManager.h',
     'MessageManagerGlobal.h',
     'MessageSender.h',
     'MozQueryInterface.h',
     'NameSpaceConstants.h',
     'Navigator.h',
     'NodeInfo.h',
     'NodeInfoInlines.h',
     'NodeIterator.h',
-    'ParentProcessMessageManager.h',
     'Pose.h',
     'ProcessGlobal.h',
-    'ProcessMessageManager.h',
     'ResponsiveImageSelector.h',
     'SameProcessMessageQueue.h',
     'ScreenOrientation.h',
     'Selection.h',
     'ShadowRoot.h',
     'StructuredCloneBlob.h',
     'StructuredCloneHolder.h',
     'StructuredCloneTags.h',
@@ -269,17 +266,16 @@ UNIFIED_SOURCES += [
     'IdleDeadline.cpp',
     'IdleRequest.cpp',
     'IDTracker.cpp',
     'ImageEncoder.cpp',
     'ImageTracker.cpp',
     'IntlUtils.cpp',
     'Link.cpp',
     'Location.cpp',
-    'MessageBroadcaster.cpp',
     'MessageListenerManager.cpp',
     'MessageManagerGlobal.cpp',
     'MessageSender.cpp',
     'MozQueryInterface.cpp',
     'Navigator.cpp',
     'NodeInfo.cpp',
     'NodeIterator.cpp',
     'nsAttrAndChildArray.cpp',
@@ -343,21 +339,19 @@ UNIFIED_SOURCES += [
     'nsTreeSanitizer.cpp',
     'nsViewportInfo.cpp',
     'nsWindowMemoryReporter.cpp',
     'nsWindowRoot.cpp',
     'nsWrapperCache.cpp',
     'nsXHTMLContentSerializer.cpp',
     'nsXMLContentSerializer.cpp',
     'nsXMLNameSpaceMap.cpp',
-    'ParentProcessMessageManager.cpp',
     'Pose.cpp',
     'PostMessageEvent.cpp',
     'ProcessGlobal.cpp',
-    'ProcessMessageManager.cpp',
     'ResponsiveImageSelector.cpp',
     'SameProcessMessageQueue.cpp',
     'ScreenOrientation.cpp',
     'Selection.cpp',
     'SelectionChangeListener.cpp',
     'ShadowRoot.cpp',
     'StructuredCloneBlob.cpp',
     'StructuredCloneHolder.cpp',
--- a/dom/base/nsCCUncollectableMarker.cpp
+++ b/dom/base/nsCCUncollectableMarker.cpp
@@ -25,19 +25,17 @@
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsJSEnvironment.h"
 #include "nsInProcessTabChildGlobal.h"
 #include "nsFrameLoader.h"
 #include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/CycleCollectedJSRuntime.h"
 #include "mozilla/EventListenerManager.h"
-#include "mozilla/dom/ChromeMessageBroadcaster.h"
 #include "mozilla/dom/Element.h"
-#include "mozilla/dom/ParentProcessMessageManager.h"
 #include "mozilla/dom/ProcessGlobal.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/TimeoutManager.h"
 #include "xpcpublic.h"
 #include "nsObserverService.h"
 #include "nsFocusManager.h"
 #include "nsIInterfaceRequestorUtils.h"
 
@@ -83,29 +81,30 @@ nsCCUncollectableMarker::Init()
   NS_ENSURE_SUCCESS(rv, rv);
 
   sInited = true;
 
   return NS_OK;
 }
 
 static void
-MarkChildMessageManagers(MessageBroadcaster* aMM)
+MarkChildMessageManagers(ChromeMessageBroadcaster* aMM)
 {
   aMM->MarkForCC();
 
   uint32_t tabChildCount = aMM->ChildCount();
   for (uint32_t j = 0; j < tabChildCount; ++j) {
     RefPtr<MessageListenerManager> childMM = aMM->GetChildAt(j);
     if (!childMM) {
       continue;
     }
 
-    RefPtr<MessageBroadcaster> strongNonLeafMM = MessageBroadcaster::From(childMM);
-    MessageBroadcaster* nonLeafMM = strongNonLeafMM;
+    RefPtr<ChromeMessageBroadcaster> strongNonLeafMM =
+      ChromeMessageBroadcaster::From(childMM);
+    ChromeMessageBroadcaster* nonLeafMM = strongNonLeafMM;
 
     MessageListenerManager* tabMM = childMM;
 
     strongNonLeafMM = nullptr;
     childMM = nullptr;
 
     if (nonLeafMM) {
       MarkChildMessageManagers(nonLeafMM);
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -34,17 +34,16 @@
 #include "mozilla/AutoRestore.h"
 #include "mozilla/AutoTimelineMarker.h"
 #include "mozilla/Base64.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/CustomElementRegistry.h"
-#include "mozilla/dom/MessageBroadcaster.h"
 #include "mozilla/dom/DocumentFragment.h"
 #include "mozilla/dom/DOMException.h"
 #include "mozilla/dom/DOMExceptionBinding.h"
 #include "mozilla/dom/DOMTypes.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ElementInlines.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/FileSystemSecurity.h"
@@ -7714,28 +7713,28 @@ nsContentUtils::GetHostOrIPv6WithBracket
   if (NS_FAILED(rv)) {
     return rv;
   }
   CopyUTF8toUTF16(hostname, aHost);
   return NS_OK;
 }
 
 bool
-nsContentUtils::CallOnAllRemoteChildren(MessageBroadcaster* aManager,
+nsContentUtils::CallOnAllRemoteChildren(ChromeMessageBroadcaster* aManager,
                                         CallOnRemoteChildFunction aCallback,
                                         void* aArg)
 {
   uint32_t tabChildCount = aManager->ChildCount();
   for (uint32_t j = 0; j < tabChildCount; ++j) {
     RefPtr<MessageListenerManager> childMM = aManager->GetChildAt(j);
     if (!childMM) {
       continue;
     }
 
-    RefPtr<MessageBroadcaster> nonLeafMM = MessageBroadcaster::From(childMM);
+    RefPtr<ChromeMessageBroadcaster> nonLeafMM = ChromeMessageBroadcaster::From(childMM);
     if (nonLeafMM) {
       if (CallOnAllRemoteChildren(nonLeafMM, aCallback, aArg)) {
         return true;
       }
       continue;
     }
 
     mozilla::dom::ipc::MessageManagerCallback* cb = childMM->GetCallback();
@@ -7755,17 +7754,17 @@ nsContentUtils::CallOnAllRemoteChildren(
 
 void
 nsContentUtils::CallOnAllRemoteChildren(nsPIDOMWindowOuter* aWindow,
                                         CallOnRemoteChildFunction aCallback,
                                         void* aArg)
 {
   nsGlobalWindowOuter* window = nsGlobalWindowOuter::Cast(aWindow);
   if (window->IsChromeWindow()) {
-    RefPtr<MessageBroadcaster> windowMM = window->GetMessageManager();
+    RefPtr<ChromeMessageBroadcaster> windowMM = window->GetMessageManager();
     if (windowMM) {
       CallOnAllRemoteChildren(windowMM, aCallback, aArg);
     }
   }
 }
 
 struct UIStateChangeInfo {
   UIStateChangeType mShowAccelerators;
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -120,27 +120,27 @@ template<class T> class nsReadingIterato
 
 namespace mozilla {
 class Dispatcher;
 class ErrorResult;
 class EventListenerManager;
 class HTMLEditor;
 
 namespace dom {
+class ChromeMessageBroadcaster;
 struct CustomElementDefinition;
 class DocumentFragment;
 class Element;
 class Event;
 class EventTarget;
 class HTMLInputElement;
 class IPCDataTransfer;
 class IPCDataTransferItem;
 struct LifecycleCallbackArgs;
 struct LifecycleAdoptedCallbackArgs;
-class MessageBroadcaster;
 class NodeInfo;
 class nsIContentChild;
 class nsIContentParent;
 class TabChild;
 class Selection;
 class TabParent;
 } // namespace dom
 
@@ -3324,17 +3324,17 @@ private:
   static mozilla::EventClassID
   GetEventClassIDFromMessage(mozilla::EventMessage aEventMessage);
 
   // Fills in aInfo with the tokens from the supplied autocomplete attribute.
   static AutocompleteAttrState InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrVal,
                                                                       mozilla::dom::AutocompleteInfo& aInfo,
                                                                       bool aGrantAllValidValue = false);
 
-  static bool CallOnAllRemoteChildren(mozilla::dom::MessageBroadcaster* aManager,
+  static bool CallOnAllRemoteChildren(mozilla::dom::ChromeMessageBroadcaster* aManager,
                                       CallOnRemoteChildFunction aCallback,
                                       void* aArg);
 
   /**
    * Gets the current cookie lifetime policy and cookie behavior for a given
    * principal by checking with preferences and the permission manager.
    *
    * Used in the implementation of InternalStorageAllowedForPrincipal.
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -18,17 +18,20 @@
 #include "nsCSSPseudoElements.h"
 #include "nsError.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsServiceManagerUtils.h"
 #include "nsTextFragment.h"
 #include "nsThreadUtils.h"
 
 using namespace mozilla;
-using namespace mozilla::dom;
+
+using mozilla::dom::TreeOrderComparator;
+using mozilla::dom::Animation;
+using mozilla::dom::Element;
 
 AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
   nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
 
 uint32_t nsDOMMutationObserver::sMutationLevel = 0;
 uint64_t nsDOMMutationObserver::sCount = 0;
 
 AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2942,17 +2942,17 @@ nsFrameLoader::EnsureMessageManager()
 
     if (!parentManager) {
       parentManager = window->GetMessageManager();
     }
   } else {
     parentManager = nsFrameMessageManager::GetGlobalMessageManager();
   }
 
-  mMessageManager = new ChromeMessageSender(parentManager);
+  mMessageManager = new ChromeMessageSender(nullptr, parentManager);
   if (!IsRemoteFrame()) {
     nsresult rv = MaybeCreateDocShell();
     if (NS_FAILED(rv)) {
       return rv;
     }
     NS_ASSERTION(mDocShell,
                  "MaybeCreateDocShell succeeded, but null mDocShell");
     if (!mDocShell) {
@@ -3383,17 +3383,17 @@ nsFrameLoader::PopulateUserContextIdFrom
       aAttr.mUserContextId = userContextIdStr.ToInteger(&rv);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   return NS_OK;
 }
 
-ProcessMessageManager*
+ChromeMessageSender*
 nsFrameLoader::GetProcessMessageManager() const
 {
   return mRemoteBrowser ? mRemoteBrowser->Manager()->GetMessageManager()
                         : nullptr;
 };
 
 JSObject*
 nsFrameLoader::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -48,17 +48,16 @@ namespace mozilla {
 
 class OriginAttributes;
 
 namespace dom {
 class ChromeMessageSender;
 class ContentParent;
 class MessageSender;
 class PBrowserParent;
-class ProcessMessageManager;
 class Promise;
 class TabParent;
 class MutableTabContext;
 
 namespace ipc {
 class StructuredCloneData;
 } // namespace ipc
 
@@ -329,17 +328,17 @@ public:
    */
   void ApplySandboxFlags(uint32_t sandboxFlags);
 
   void GetURL(nsString& aURL, nsIPrincipal** aTriggeringPrincipal);
 
   // Properly retrieves documentSize of any subdocument type.
   nsresult GetWindowDimensions(nsIntRect& aRect);
 
-  virtual mozilla::dom::ProcessMessageManager* GetProcessMessageManager() const override;
+  virtual mozilla::dom::ChromeMessageSender* GetProcessMessageManager() const override;
 
   // public because a callback needs these.
   RefPtr<mozilla::dom::ChromeMessageSender> mMessageManager;
   RefPtr<nsInProcessTabChildGlobal> mChildMessageManager;
 
   virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
 
 private:
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -31,24 +31,23 @@
 #include "xpcpublic.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ScriptPreloader.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/ChildProcessMessageManager.h"
 #include "mozilla/dom/ChromeMessageBroadcaster.h"
+#include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 #include "mozilla/dom/MessagePort.h"
 #include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/ParentProcessMessageManager.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/ProcessGlobal.h"
-#include "mozilla/dom/ProcessMessageManager.h"
 #include "mozilla/dom/ResolveSystemBinding.h"
 #include "mozilla/dom/SameProcessMessageQueue.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsPrintfCString.h"
@@ -157,17 +156,17 @@ NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFrameMessageManager)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFrameMessageManager)
 
 nsresult 
 MessageManagerCallback::DoGetRemoteType(nsAString& aRemoteType) const
 {
   aRemoteType.Truncate();
-  mozilla::dom::ProcessMessageManager* parent = GetProcessMessageManager();
+  mozilla::dom::ChromeMessageSender* parent = GetProcessMessageManager();
   if (!parent) {
     return NS_OK;
   }
 
   ErrorResult rv;
   parent->GetRemoteType(aRemoteType, rv);
   return rv.StealNSResult();
 }
@@ -947,34 +946,36 @@ nsFrameMessageManager::SetCallback(Messa
 }
 
 void
 nsFrameMessageManager::Close()
 {
   if (!mClosed) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
-      obs->NotifyObservers(this, "message-manager-close", nullptr);
+      obs->NotifyObservers(NS_ISUPPORTS_CAST(nsIContentFrameMessageManager*, this),
+                            "message-manager-close", nullptr);
     }
   }
   mClosed = true;
   mCallback = nullptr;
   mOwnedCallback = nullptr;
 }
 
 void
 nsFrameMessageManager::Disconnect(bool aRemoveFromParent)
 {
   // Notify message-manager-close if we haven't already.
   Close();
 
   if (!mDisconnected) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
-       obs->NotifyObservers(this, "message-manager-disconnect", nullptr);
+       obs->NotifyObservers(NS_ISUPPORTS_CAST(nsIContentFrameMessageManager*, this),
+                            "message-manager-disconnect", nullptr);
     }
   }
 
   ClearParentManager(aRemoveFromParent);
 
   mDisconnected = true;
   if (!mHandlingMessage) {
     mListeners.Clear();
@@ -1029,20 +1030,20 @@ nsFrameMessageManager::GetInitialProcess
 
   if (!JS_WrapValue(aCx, &init)) {
     aError.NoteJSContextException(aCx);
     return;
   }
   aInitialProcessData.set(init);
 }
 
-already_AddRefed<ProcessMessageManager>
+already_AddRefed<ChromeMessageSender>
 nsFrameMessageManager::GetProcessMessageManager(ErrorResult& aError)
 {
-  RefPtr<ProcessMessageManager> pmm;
+  RefPtr<ChromeMessageSender> pmm;
   if (mCallback) {
     pmm = mCallback->GetProcessMessageManager();
   }
   return pmm.forget();
 }
 
 void
 nsFrameMessageManager::GetRemoteType(nsAString& aRemoteType, ErrorResult& aError) const
@@ -1471,32 +1472,32 @@ nsMessageManagerScriptExecutor::MarkScop
   for (uint32_t i = 0; i < mAnonymousGlobalScopes.Length(); ++i) {
     mAnonymousGlobalScopes[i].exposeToActiveJS();
   }
 }
 
 NS_IMPL_ISUPPORTS(nsScriptCacheCleaner, nsIObserver)
 
 ChildProcessMessageManager* nsFrameMessageManager::sChildProcessManager = nullptr;
-ParentProcessMessageManager* nsFrameMessageManager::sParentProcessManager = nullptr;
+ChromeMessageBroadcaster* nsFrameMessageManager::sParentProcessManager = nullptr;
 nsFrameMessageManager* nsFrameMessageManager::sSameProcessParentManager = nullptr;
 
 class nsAsyncMessageToSameProcessChild : public nsSameProcessAsyncMessageBase,
                                          public Runnable
 {
 public:
   nsAsyncMessageToSameProcessChild(JS::RootingContext* aRootingCx,
                                    JS::Handle<JSObject*> aCpows)
     : nsSameProcessAsyncMessageBase(aRootingCx, aCpows)
     , mozilla::Runnable("nsAsyncMessageToSameProcessChild")
   { }
   NS_IMETHOD Run() override
   {
     nsFrameMessageManager* ppm = nsFrameMessageManager::GetChildProcessManager();
-    ReceiveMessage(ppm, nullptr, ppm);
+    ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm), nullptr, ppm);
     return NS_OK;
   }
 };
 
 
 /**
  * Send messages to an imaginary child process in a single-process scenario.
  */
@@ -1623,17 +1624,17 @@ class nsAsyncMessageToSameProcessParent 
 public:
   nsAsyncMessageToSameProcessParent(JS::RootingContext* aRootingCx,
                                     JS::Handle<JSObject*> aCpows)
     : nsSameProcessAsyncMessageBase(aRootingCx, aCpows)
   { }
   nsresult HandleMessage() override
   {
     nsFrameMessageManager* ppm = nsFrameMessageManager::sSameProcessParentManager;
-    ReceiveMessage(ppm, nullptr, ppm);
+    ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm), nullptr, ppm);
     return NS_OK;
   }
 };
 
 /**
  * Send messages to the imaginary parent process in a single-process scenario.
  */
 class SameChildProcessMessageManagerCallback : public MessageManagerCallback
@@ -1691,44 +1692,47 @@ public:
 
 
 // This creates the global parent process message manager.
 nsresult
 NS_NewParentProcessMessageManager(nsISupports** aResult)
 {
   NS_ASSERTION(!nsFrameMessageManager::sParentProcessManager,
                "Re-creating sParentProcessManager");
-  RefPtr<ParentProcessMessageManager> mm = new ParentProcessMessageManager();
+  RefPtr<ChromeMessageBroadcaster> mm =
+    new ChromeMessageBroadcaster(MessageManagerFlags::MM_PROCESSMANAGER);
   nsFrameMessageManager::sParentProcessManager = mm;
   nsFrameMessageManager::NewProcessMessageManager(false); // Create same process message manager.
   mm.forget(aResult);
   return NS_OK;
 }
 
 
-ProcessMessageManager*
+ChromeMessageSender*
 nsFrameMessageManager::NewProcessMessageManager(bool aIsRemote)
 {
   if (!nsFrameMessageManager::sParentProcessManager) {
      nsCOMPtr<nsISupports> dummy =
        do_GetService("@mozilla.org/parentprocessmessagemanager;1");
   }
 
   MOZ_ASSERT(nsFrameMessageManager::sParentProcessManager,
              "parent process manager not created");
-  ProcessMessageManager* mm;
+  ChromeMessageSender* mm;
   if (aIsRemote) {
     // Callback is set in ContentParent::InitInternal so that the process has
     // already started when we send pending scripts.
-    mm = new ProcessMessageManager(nullptr,
-                                   nsFrameMessageManager::sParentProcessManager);
+    mm = new ChromeMessageSender(nullptr,
+                                 nsFrameMessageManager::sParentProcessManager,
+                                 MessageManagerFlags::MM_PROCESSMANAGER);
   } else {
-    mm = new ProcessMessageManager(new SameParentProcessMessageManagerCallback(),
-                                   nsFrameMessageManager::sParentProcessManager,
-                                   MessageManagerFlags::MM_OWNSCALLBACK);
+    mm = new ChromeMessageSender(new SameParentProcessMessageManagerCallback(),
+                                 nsFrameMessageManager::sParentProcessManager,
+                                 MessageManagerFlags::MM_PROCESSMANAGER |
+                                 MessageManagerFlags::MM_OWNSCALLBACK);
     sSameProcessParentManager = mm;
   }
   return mm;
 }
 
 nsresult
 NS_NewChildProcessMessageManager(nsISupports** aResult)
 {
--- a/dom/base/nsFrameMessageManager.h
+++ b/dom/base/nsFrameMessageManager.h
@@ -38,24 +38,22 @@ class nsFrameLoader;
 
 namespace mozilla {
 namespace dom {
 
 class nsIContentParent;
 class nsIContentChild;
 class ChildProcessMessageManager;
 class ChromeMessageBroadcaster;
+class ChromeMessageSender;
 class ClonedMessageData;
-class MessageBroadcaster;
 class MessageListener;
 class MessageListenerManager;
 class MessageManagerReporter;
 template<typename T> class Optional;
-class ParentProcessMessageManager;
-class ProcessMessageManager;
 
 namespace ipc {
 
 // Note: we round the time we spend to the nearest millisecond. So a min value
 // of 1 ms actually captures from 500us and above.
 static const uint32_t kMinTelemetrySyncMessageManagerLatencyMs = 1;
 
 enum class MessageManagerFlags {
@@ -93,17 +91,17 @@ public:
                                       const nsAString& aMessage,
                                       StructuredCloneData& aData,
                                       JS::Handle<JSObject*> aCpows,
                                       nsIPrincipal* aPrincipal)
   {
     return NS_OK;
   }
 
-  virtual mozilla::dom::ProcessMessageManager* GetProcessMessageManager() const
+  virtual mozilla::dom::ChromeMessageSender* GetProcessMessageManager() const
   {
     return nullptr;
   }
 
   virtual nsresult DoGetRemoteType(nsAString& aRemoteType) const;
 
 protected:
   bool BuildClonedMessageDataForParent(nsIContentParent* aParent,
@@ -198,17 +196,17 @@ public:
                         JS::Handle<JSObject*> aObjects,
                         nsIPrincipal* aPrincipal,
                         JS::Handle<JS::Value> aTransfers,
                         mozilla::ErrorResult& aError)
   {
     DispatchAsyncMessage(aCx, aMessageName, aObj, aObjects, aPrincipal, aTransfers,
                          aError);
   }
-  already_AddRefed<mozilla::dom::ProcessMessageManager>
+  already_AddRefed<mozilla::dom::ChromeMessageSender>
     GetProcessMessageManager(mozilla::ErrorResult& aError);
   void GetRemoteType(nsAString& aRemoteType, mozilla::ErrorResult& aError) const;
 
   // SyncMessageSender
   void SendSyncMessage(JSContext* aCx, const nsAString& aMessageName,
                        JS::Handle<JS::Value> aObj,
                        JS::Handle<JSObject*> aObjects,
                        nsIPrincipal* aPrincipal,
@@ -230,17 +228,18 @@ public:
   // GlobalProcessScriptLoader
   void GetInitialProcessData(JSContext* aCx,
                              JS::MutableHandle<JS::Value> aInitialProcessData,
                              mozilla::ErrorResult& aError);
 
   NS_DECL_NSIMESSAGESENDER
   NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER
 
-  static mozilla::dom::ProcessMessageManager* NewProcessMessageManager(bool aIsRemote);
+  static mozilla::dom::ChromeMessageSender*
+  NewProcessMessageManager(bool aIsRemote);
 
   void ReceiveMessage(nsISupports* aTarget, nsFrameLoader* aTargetFrameLoader,
                       const nsAString& aMessage, bool aIsSync,
                       StructuredCloneData* aCloneData, mozilla::jsipc::CpowHolder* aCpows,
                       nsIPrincipal* aPrincipal, nsTArray<StructuredCloneData>* aRetVal,
                       mozilla::ErrorResult& aError)
   {
     ReceiveMessage(aTarget, aTargetFrameLoader, mClosed, aMessage, aIsSync, aCloneData,
@@ -264,17 +263,17 @@ public:
                                         nsIPrincipal* aPrincipal);
   bool IsGlobal() { return mGlobal; }
   bool IsBroadcaster() { return mIsBroadcaster; }
   bool IsChrome() { return mChrome; }
 
   // GetGlobalMessageManager creates the global message manager if it hasn't been yet.
   static already_AddRefed<mozilla::dom::ChromeMessageBroadcaster>
     GetGlobalMessageManager();
-  static mozilla::dom::ParentProcessMessageManager* GetParentProcessManager()
+  static mozilla::dom::ChromeMessageBroadcaster* GetParentProcessManager()
   {
     return sParentProcessManager;
   }
   static mozilla::dom::ChildProcessMessageManager* GetChildProcessManager()
   {
     return sChildProcessManager;
   }
   static void SetChildProcessManager(mozilla::dom::ChildProcessMessageManager* aManager)
@@ -284,17 +283,17 @@ public:
 
   void SetInitialProcessData(JS::HandleValue aInitialData);
 
   void LoadPendingScripts();
 
 protected:
   friend class MMListenerRemover;
 
-  virtual mozilla::dom::MessageBroadcaster* GetParentManager()
+  virtual mozilla::dom::ChromeMessageBroadcaster* GetParentManager()
   {
     return nullptr;
   }
   virtual void ClearParentManager(bool aRemove)
   {
   }
 
   void DispatchAsyncMessage(JSContext* aCx, const nsAString& aMessageName,
@@ -361,17 +360,17 @@ protected:
   nsAutoPtr<mozilla::dom::ipc::MessageManagerCallback> mOwnedCallback;
   nsTArray<nsString> mPendingScripts;
   nsTArray<bool> mPendingScriptsGlobalStates;
   JS::Heap<JS::Value> mInitialProcessData;
 
   void LoadPendingScripts(nsFrameMessageManager* aManager,
                           nsFrameMessageManager* aChildMM);
 public:
-  static mozilla::dom::ParentProcessMessageManager* sParentProcessManager;
+  static mozilla::dom::ChromeMessageBroadcaster* sParentProcessManager;
   static nsFrameMessageManager* sSameProcessParentManager;
   static nsTArray<nsCOMPtr<nsIRunnable> >* sPendingSameProcessAsyncMessages;
 private:
   static mozilla::dom::ChildProcessMessageManager* sChildProcessManager;
 };
 
 /* A helper class for taking care of many details for async message sending
    within a single process.  Intended to be used like so:
--- a/dom/base/nsIdentifierMapEntry.h
+++ b/dom/base/nsIdentifierMapEntry.h
@@ -14,30 +14,23 @@
 #include "PLDHashTable.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Move.h"
 #include "mozilla/net/ReferrerPolicy.h"
 
 #include "nsCOMPtr.h"
 #include "nsAtom.h"
-#include "nsHashKeys.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 
 class nsIContent;
 class nsContentList;
 class nsBaseContentList;
 
-namespace mozilla {
-namespace dom {
-class Element;
-}
-}
-
 /**
  * Right now our identifier map entries contain information for 'name'
  * and 'id' mappings of a given string. This is so that
  * nsHTMLDocument::ResolveName only has to do one hash lookup instead
  * of two. It's not clear whether this still matters for performance.
  *
  * We also store the document.all result list here. This is mainly so that
  * when all elements with the given ID are removed and we remove
--- a/dom/chrome-webidl/MessageManager.webidl
+++ b/dom/chrome-webidl/MessageManager.webidl
@@ -14,17 +14,17 @@ interface Principal;
  * These don't always correspond to process boundaries, but can.  For
  * each child-side message manager, there is always exactly one
  * corresponding parent-side message manager that it sends messages
  * to.  However, for each parent-side message manager, there may be
  * either one or many child-side managers it can message.
  *
  * Message managers that always have exactly one "other side" are of
  * type MessageSender.  Parent-side message managers that have many
- * "other sides" are of type MessageBroadcaster.
+ * "other sides" are of type ChromeMessageBroadcaster.
  *
  * Child-side message managers can send synchronous messages to their
  * parent side, but not the other way around.
  *
  * There are two realms of message manager hierarchies.  One realm
  * approximately corresponds to DOM elements, the other corresponds to
  * process boundaries.
  *
@@ -89,23 +89,23 @@ interface Principal;
  * can result in messages being dispatched across many OS processes,
  * and to many processes with different permissions.  Great care
  * should be taken when broadcasting.
  *
  * Interfaces
  * ----------
  *
  * The global MMg and window MMw's are message broadcasters implementing
- * MessageBroadcaster while the frame MMp's are simple message senders (MessageSender).
- * Their counterparts in the content processes are message senders implementing
- * ContentFrameMessageManager.
+ * ChromeMessageBroadcaster while the frame MMp's are simple message
+ * senders (MessageSender). Their counterparts in the content processes
+ * are message senders implementing ContentFrameMessageManager.
  *
  *                 MessageListenerManager
  *               /                        \
- * MessageSender                            MessageBroadcaster
+ * MessageSender                            ChromeMessageBroadcaster
  *       |
  * SyncMessageSender (content process/in-process only)
  *       |
  * ContentFrameMessageManager (content process/in-process only)
  *       |
  * nsIInProcessContentFrameMessageManager (in-process only)
  *
  *
@@ -347,20 +347,16 @@ interface SyncMessageSender : MessageSen
    */
   [Throws]
   sequence<any> sendRpcMessage(optional DOMString? messageName = null,
                                optional any obj,
                                optional object? objects = null,
                                optional Principal? principal = null);
 };
 
-/**
- * ChildProcessMessageManager is used in a child process to communicate with the parent
- * process.
- */
 [ChromeOnly]
 interface ChildProcessMessageManager : SyncMessageSender
 {
 };
 
 [NoInterfaceObject]
 interface MessageManagerGlobal : SyncMessageSender
 {
@@ -502,17 +498,17 @@ ContentProcessMessageManager implements 
 
 /**
  * Message "broadcasters" don't have a single "other side" that they send messages to, but
  * rather a set of subordinate message managers. For example, broadcasting a message
  * through a window message manager will broadcast the message to all frame message
  * managers within its window.
  */
 [ChromeOnly]
-interface MessageBroadcaster : MessageListenerManager
+interface ChromeMessageBroadcaster : MessageListenerManager
 {
   /**
    * Like |sendAsyncMessage()|, but also broadcasts this message to
    * all "child" message managers of this message manager.  See long
    * comment above for details.
    *
    * WARNING: broadcasting messages can be very expensive and leak
    * sensitive data.  Use with extreme caution.
@@ -533,43 +529,17 @@ interface MessageBroadcaster : MessageLi
   MessageListenerManager getChildAt(unsigned long aIndex);
 
   /**
    * Some processes are kept alive after their last tab/window are closed for testing
    * (see dom.ipc.keepProcessesAlive). This function releases those.
    */
    void releaseCachedProcesses();
 };
-
-/**
- * ChromeMessageBroadcaster is used for window and group message managers.
- */
-[ChromeOnly]
-interface ChromeMessageBroadcaster : MessageBroadcaster
-{
-};
+ChromeMessageBroadcaster implements GlobalProcessScriptLoader;
 ChromeMessageBroadcaster implements FrameScriptLoader;
 
-/**
- * ParentProcessMessageManager is used in a parent process to communicate with all the
- * child processes.
- */
-[ChromeOnly]
-interface ParentProcessMessageManager : MessageBroadcaster
-{
-};
-ParentProcessMessageManager implements GlobalProcessScriptLoader;
-
 [ChromeOnly]
 interface ChromeMessageSender : MessageSender
 {
 };
+ChromeMessageSender implements ProcessScriptLoader;
 ChromeMessageSender implements FrameScriptLoader;
-
-/**
- * ProcessMessageManager is used in a parent process to communicate with a child process
- * (or with the process itself in a single-process scenario).
- */
-[ChromeOnly]
-interface ProcessMessageManager : MessageSender
-{
-};
-ProcessMessageManager implements ProcessScriptLoader;
--- a/dom/ipc/ContentBridgeParent.cpp
+++ b/dom/ipc/ContentBridgeParent.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 "mozilla/dom/ContentBridgeParent.h"
-#include "mozilla/dom/ProcessMessageManager.h"
+#include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsXULAppAPI.h"
 #include "nsIObserverService.h"
 #include "base/task.h"
 
 using namespace mozilla::ipc;
 using namespace mozilla::jsipc;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -152,18 +152,17 @@
 #include "nsIDocShellTreeOwner.h"
 #include "nsIXULWindow.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsIWindowWatcher.h"
 #include "nsPIWindowWatcher.h"
 #include "nsThread.h"
 #include "nsWindowWatcher.h"
 #include "nsIXULRuntime.h"
-#include "mozilla/dom/ParentProcessMessageManager.h"
-#include "mozilla/dom/ProcessMessageManager.h"
+#include "mozilla/dom/ChromeMessageBroadcaster.h"
 #include "mozilla/dom/nsMixedContentBlocker.h"
 #include "nsMemoryInfoDumper.h"
 #include "nsMemoryReporterManager.h"
 #include "nsScriptError.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleSheetService.h"
 #include "nsThreadUtils.h"
 #include "nsToolkitCompsCID.h"
@@ -530,17 +529,17 @@ ScriptableCPInfo::GetTabCount(int32_t* a
 NS_IMETHODIMP
 ScriptableCPInfo::GetMessageManager(nsISupports** aMessenger)
 {
   *aMessenger = nullptr;
   if (!mContentParent) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
-  RefPtr<ProcessMessageManager> manager = mContentParent->GetMessageManager();
+  RefPtr<ChromeMessageSender> manager = mContentParent->GetMessageManager();
   manager.forget(aMessenger);
   return NS_OK;
 }
 
 ProcessID
 GetTelemetryProcessID(const nsAString& remoteType)
 {
   // OOP WebExtensions run in a content process.
@@ -2234,17 +2233,17 @@ ContentParent::InitInternal(ProcessPrior
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   // Let's copy the domain policy from the parent to the child (if it's active).
   StructuredCloneData initialData;
   nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
   if (ssm) {
     ssm->CloneDomainPolicy(&xpcomInit.domainPolicy());
 
-    if (ParentProcessMessageManager* mm = nsFrameMessageManager::sParentProcessManager) {
+    if (ChromeMessageBroadcaster* mm = nsFrameMessageManager::sParentProcessManager) {
       AutoJSAPI jsapi;
       if (NS_WARN_IF(!jsapi.Init(xpc::PrivilegedJunkScope()))) {
         MOZ_CRASH();
       }
       JS::RootedValue init(jsapi.cx());
       // We'll crash on failure, so use a IgnoredErrorResult (which also auto-suppresses
       // exceptions).
       IgnoredErrorResult rv;
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -3,22 +3,22 @@
 /* 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 "nsIContentParent.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/File.h"
+#include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentBridgeParent.h"
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/PTabContext.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
-#include "mozilla/dom/ProcessMessageManager.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "mozilla/ipc/FileDescriptorSetParent.h"
 #include "mozilla/ipc/PFileDescriptorSetParent.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/IPCStreamDestination.h"
--- a/dom/ipc/nsIContentParent.h
+++ b/dom/ipc/nsIContentParent.h
@@ -39,17 +39,17 @@ class PParentToChildStreamParent;
 class PIPCBlobInputStreamParent;
 }
 
 namespace dom {
 
 class Blob;
 class BlobConstructorParams;
 class BlobImpl;
-class ProcessMessageManager;
+class ChromeMessageSender;
 class ContentParent;
 class ContentBridgeParent;
 class IPCTabContext;
 class PBrowserParent;
 
 class nsIContentParent : public nsISupports
                        , public mozilla::dom::ipc::MessageManagerCallback
                        , public CPOWManagerGetter
@@ -84,17 +84,17 @@ public:
   virtual bool IsContentParent() const { return false; }
 
   ContentParent* AsContentParent();
 
   virtual bool IsContentBridgeParent() const { return false; }
 
   ContentBridgeParent* AsContentBridgeParent();
 
-  mozilla::dom::ProcessMessageManager* GetMessageManager() const { return mMessageManager; }
+  mozilla::dom::ChromeMessageSender* GetMessageManager() const { return mMessageManager; }
 
   virtual bool SendActivate(PBrowserParent* aTab) = 0;
 
   virtual bool SendDeactivate(PBrowserParent* aTab) = 0;
 
   virtual int32_t Pid() const = 0;
 
   virtual mozilla::ipc::PParentToChildStreamParent*
@@ -157,17 +157,17 @@ protected: // IPDL methods
                                                  const IPC::Principal& aPrincipal,
                                                  nsTArray<ipc::StructuredCloneData>* aRetvals);
   virtual mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg,
                                                    InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                                    const IPC::Principal& aPrincipal,
                                                    const ClonedMessageData& aData);
 
 protected: // members
-  RefPtr<mozilla::dom::ProcessMessageManager> mMessageManager;
+  RefPtr<mozilla::dom::ChromeMessageSender> mMessageManager;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentParent, NS_ICONTENTPARENT_IID)
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_nsIContentParent_h */
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -9,17 +9,16 @@
 #ifndef nsComputedDOMStyle_h__
 #define nsComputedDOMStyle_h__
 
 #include "mozilla/ArenaRefPtr.h"
 #include "mozilla/ArenaRefPtrInlines.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/StyleComplexColor.h"
 #include "mozilla/UniquePtr.h"
-#include "mozilla/dom/Element.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nscore.h"
 #include "nsDOMCSSDeclaration.h"
 #include "mozilla/ComputedStyle.h"
 #include "nsIWeakReferenceUtils.h"
 #include "mozilla/gfx/Types.h"
 #include "nsCoord.h"