diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index 7600b9193056..f346c531f0cb 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -23,7 +23,6 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/TimeStamp.h" #include "mozilla/dom/BrowsingContext.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/IdleDeadline.h" #include "mozilla/dom/JSWindowActorService.h" @@ -1188,11 +1187,6 @@ void ChromeUtils::GenerateMediaControlKeysTestEvent( } } -/* static */ -nsIContentChild* ChromeUtils::GetContentChild(const GlobalObject&) { - return ContentChild::GetSingleton(); -} - /* static */ void ChromeUtils::GetCurrentActiveMediaMetadata(const GlobalObject& aGlobal, MediaMetadataInit& aMetadata) { diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h index b4909fbd6026..d585ce387afb 100644 --- a/dom/base/ChromeUtils.h +++ b/dom/base/ChromeUtils.h @@ -11,7 +11,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ChromeUtilsBinding.h" #include "mozilla/ErrorResult.h" -#include "nsIContentChild.h" namespace mozilla { @@ -204,8 +203,6 @@ class ChromeUtils { static void GenerateMediaControlKeysTestEvent( const GlobalObject& aGlobal, MediaControlKeysTestEvent aEvent); - static nsIContentChild* GetContentChild(const GlobalObject&); - // This function would only be used for testing. static void GetCurrentActiveMediaMetadata(const GlobalObject& aGlobal, MediaMetadataInit& aMetadata); diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 68582a0e8a57..8eb684484065 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -1885,8 +1885,6 @@ addExternalIface('nsITreeSelection', nativeType='nsITreeSelection', notflattened=True) addExternalIface('nsISupports', nativeType='nsISupports') addExternalIface('nsIDocShell', nativeType='nsIDocShell', notflattened=True) -addExternalIface('nsIContentChild', nativeType='nsIContentChild', notflattened=True) -addExternalIface('nsIContentParent', nativeType='nsIContentParent', notflattened=True) addExternalIface('nsIReferrerInfo', nativeType='nsIReferrerInfo', notflattened=True) addExternalIface('nsIWebNavigation', nativeType='nsIWebNavigation', notflattened=True) addExternalIface('nsIEditor', nativeType='nsIEditor', notflattened=True) diff --git a/dom/chrome-webidl/ChromeUtils.webidl b/dom/chrome-webidl/ChromeUtils.webidl index a185b94ee794..79c144026a83 100644 --- a/dom/chrome-webidl/ChromeUtils.webidl +++ b/dom/chrome-webidl/ChromeUtils.webidl @@ -446,12 +446,6 @@ partial namespace ChromeUtils { [ChromeOnly] void generateMediaControlKeysTestEvent(MediaControlKeysTestEvent aEvent); - /** - * ContentChild of the current process. - */ - [ChromeOnly] - readonly attribute nsIContentChild? contentChild; - // This is used to get the media metadata from the current main controller in // testing. [ChromeOnly] diff --git a/dom/chrome-webidl/JSWindowActor.webidl b/dom/chrome-webidl/JSWindowActor.webidl index c330133b35f3..403acf98b996 100644 --- a/dom/chrome-webidl/JSWindowActor.webidl +++ b/dom/chrome-webidl/JSWindowActor.webidl @@ -5,8 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ interface nsISupports; -interface nsIContentChild; -interface nsIContentParent; interface mixin JSWindowActor { [Throws] diff --git a/dom/chrome-webidl/WindowGlobalActors.webidl b/dom/chrome-webidl/WindowGlobalActors.webidl index 25dd41eabc40..1a77444d1b9f 100644 --- a/dom/chrome-webidl/WindowGlobalActors.webidl +++ b/dom/chrome-webidl/WindowGlobalActors.webidl @@ -54,10 +54,6 @@ interface WindowGlobalParent : WindowContext { // String containing serialized content blocking log. readonly attribute DOMString contentBlockingLog; - // ContentParent of the process this window is loaded in. - // Will be `null` for windows loaded in the parent process. - readonly attribute nsIContentParent? contentParent; - static WindowGlobalParent? getByInnerWindowId(unsigned long long innerWindowId); /** diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index d2c346478279..4330f7edb690 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -604,9 +604,8 @@ ContentChild::~ContentChild() { #endif NS_INTERFACE_MAP_BEGIN(ContentChild) - NS_INTERFACE_MAP_ENTRY(nsIContentChild) NS_INTERFACE_MAP_ENTRY(nsIWindowProvider) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentChild) + NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END mozilla::ipc::IPCResult ContentChild::RecvSetXPCOMProcessAttributes( @@ -2871,8 +2870,7 @@ void ContentChild::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure) { mozilla::ipc::IPCResult ContentChild::RecvShutdown() { nsCOMPtr os = services::GetObserverService(); if (os) { - os->NotifyObservers(ToSupports(this), "content-child-will-shutdown", - nullptr); + os->NotifyObservers(this, "content-child-will-shutdown", nullptr); } ShutdownInternal(); @@ -2919,7 +2917,7 @@ void ContentChild::ShutdownInternal() { nsCOMPtr os = services::GetObserverService(); if (os) { - os->NotifyObservers(ToSupports(this), "content-child-shutdown", nullptr); + os->NotifyObservers(this, "content-child-shutdown", nullptr); } #if defined(XP_WIN) @@ -4288,11 +4286,6 @@ mozilla::ipc::IPCResult ContentChild::RecvInitSandboxTesting( } #endif -NS_IMETHODIMP ContentChild::GetChildID(uint64_t* aOut) { - *aOut = mID; - return NS_OK; -} - } // namespace dom #if defined(__OpenBSD__) && defined(MOZ_SANDBOX) diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 5e174dfc3b96..c59d04cd650b 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -21,7 +21,6 @@ #include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "nsAutoPtr.h" #include "nsHashKeys.h" -#include "nsIContentChild.h" #include "nsIObserver.h" #include "nsTHashtable.h" #include "nsStringFwd.h" @@ -80,7 +79,6 @@ enum class MediaControlKeysEvent : uint32_t; class ContentChild final : public PContentChild, - public nsIContentChild, public nsIWindowProvider, public CPOWManagerGetter, public mozilla::ipc::IShmemAllocator, @@ -93,7 +91,6 @@ class ContentChild final friend class PContentChild; public: - NS_DECL_NSICONTENTCHILD NS_DECL_NSIWINDOWPROVIDER ContentChild(); @@ -897,10 +894,6 @@ class ContentChild final DISALLOW_EVIL_CONSTRUCTORS(ContentChild); }; -inline nsISupports* ToSupports(mozilla::dom::ContentChild* aContentChild) { - return static_cast(aContentChild); -} - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 32d494f86185..2c3fda27c080 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -2922,12 +2922,11 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(ContentParent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ContentParent) NS_INTERFACE_MAP_ENTRY_CONCRETE(ContentParent) - NS_INTERFACE_MAP_ENTRY(nsIContentParent) NS_INTERFACE_MAP_ENTRY(nsIObserver) NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPositionCallback) NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPositionErrorCallback) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentParent) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver) NS_INTERFACE_MAP_END NS_IMETHODIMP @@ -6453,11 +6452,6 @@ mozilla::ipc::IPCResult ContentParent::RecvCommitWindowContextTransaction( return aTransaction.CommitFromIPC(aContext, this); } -NS_IMETHODIMP ContentParent::GetChildID(uint64_t* aOut) { - *aOut = this->ChildID(); - return NS_OK; -} - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index c1c6bd80f6f2..34859208babd 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -35,7 +35,6 @@ #include "nsPluginTags.h" #include "nsFrameMessageManager.h" #include "nsHashKeys.h" -#include "nsIContentParent.h" #include "nsIInterfaceRequestor.h" #include "nsIObserver.h" #include "nsIRemoteTab.h" @@ -133,7 +132,6 @@ struct CancelContentJSOptions; class ContentParent final : public PContentParent, - public nsIContentParent, public nsIObserver, public nsIDOMGeoPositionCallback, public nsIDOMGeoPositionErrorCallback, @@ -1302,8 +1300,6 @@ class ContentParent final static bool ShouldSyncPreference(const char16_t* aData); - NS_IMETHOD GetChildID(uint64_t* aChildID) override; - private: // Return an existing ContentParent if possible. Otherwise, `nullptr`. static already_AddRefed GetUsedBrowserProcess( @@ -1495,10 +1491,6 @@ class RemoteWindowContext final : public nsIRemoteWindowContext, RefPtr mBrowserParent; }; -inline nsISupports* ToSupports(mozilla::dom::ContentParent* aContentParent) { - return static_cast(aContentParent); -} - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/JSWindowActorChild.h b/dom/ipc/JSWindowActorChild.h index fd38d42dda9e..2a2e883bd602 100644 --- a/dom/ipc/JSWindowActorChild.h +++ b/dom/ipc/JSWindowActorChild.h @@ -11,11 +11,9 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/JSWindowActor.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" -#include "nsIContentChild.h" namespace mozilla { namespace dom { diff --git a/dom/ipc/JSWindowActorParent.cpp b/dom/ipc/JSWindowActorParent.cpp index f6cec04ffd14..86db3131565b 100644 --- a/dom/ipc/JSWindowActorParent.cpp +++ b/dom/ipc/JSWindowActorParent.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/JSWindowActorBinding.h" #include "mozilla/dom/JSWindowActorParent.h" -#include "mozilla/dom/ContentParent.h" #include "mozilla/dom/WindowGlobalParent.h" #include "mozilla/dom/MessageManagerBinding.h" diff --git a/dom/ipc/JSWindowActorParent.h b/dom/ipc/JSWindowActorParent.h index dfeab3a3f492..c5bf0db2263c 100644 --- a/dom/ipc/JSWindowActorParent.h +++ b/dom/ipc/JSWindowActorParent.h @@ -11,7 +11,6 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/ContentParent.h" #include "mozilla/dom/JSWindowActor.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp index 4d80cf19cd15..3ee0ecd02674 100644 --- a/dom/ipc/WindowGlobalParent.cpp +++ b/dom/ipc/WindowGlobalParent.cpp @@ -649,15 +649,6 @@ nsIGlobalObject* WindowGlobalParent::GetParentObject() { return xpc::NativeGlobal(xpc::PrivilegedJunkScope()); } -ContentParent* WindowGlobalParent::GetContentParent() { - RefPtr browserParent = GetBrowserParent(); - if (!browserParent) { - return nullptr; - } - - return browserParent->Manager(); -} - NS_IMPL_CYCLE_COLLECTION_INHERITED(WindowGlobalParent, WindowContext, mWindowActors) diff --git a/dom/ipc/WindowGlobalParent.h b/dom/ipc/WindowGlobalParent.h index b63a779c3936..deae5984f646 100644 --- a/dom/ipc/WindowGlobalParent.h +++ b/dom/ipc/WindowGlobalParent.h @@ -19,7 +19,6 @@ #include "nsRefPtrHashtable.h" #include "nsWrapperCache.h" #include "nsISupports.h" -#include "nsIContentParent.h" #include "mozilla/dom/WindowGlobalActor.h" #include "mozilla/dom/CanonicalBrowsingContext.h" @@ -156,8 +155,6 @@ class WindowGlobalParent final : public WindowContext, ContentBlockingLog* GetContentBlockingLog() { return &mContentBlockingLog; } - ContentParent* GetContentParent(); - protected: const nsAString& GetRemoteType() override; JSWindowActor::Type GetSide() override { return JSWindowActor::Type::Parent; } diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index 93ea3846b7d2..eabd6bc58ebd 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -8,8 +8,6 @@ with Files("**"): BUG_COMPONENT = ("Core", "DOM: Content Processes") XPIDL_SOURCES += [ - 'nsIContentChild.idl', - 'nsIContentParent.idl', 'nsIHangReport.idl', 'nsIRemoteWebProgress.idl', 'nsIRemoteWebProgressRequest.idl', diff --git a/dom/ipc/nsIContentChild.idl b/dom/ipc/nsIContentChild.idl deleted file mode 100644 index d74bfb73d00b..000000000000 --- a/dom/ipc/nsIContentChild.idl +++ /dev/null @@ -1,7 +0,0 @@ -#include "nsISupports.idl" - -[scriptable, builtinclass, uuid(b0c6e5f3-02f1-4f11-a0af-336fc231f3bf)] -interface nsIContentChild: nsISupports { - // Internal ID of the process. - readonly attribute unsigned long long childID; -}; diff --git a/dom/ipc/nsIContentParent.idl b/dom/ipc/nsIContentParent.idl deleted file mode 100644 index bd4d0ebdaa6d..000000000000 --- a/dom/ipc/nsIContentParent.idl +++ /dev/null @@ -1,7 +0,0 @@ -#include "nsISupports.idl" - -[scriptable, builtinclass, uuid(81fc08b9-c901-471f-ab0d-876362eba770)] -interface nsIContentParent: nsISupports { - // Internal ID of the process. - readonly attribute unsigned long long childID; -}; diff --git a/dom/ipc/tests/JSWindowActor/browser.ini b/dom/ipc/tests/JSWindowActor/browser.ini index 5c23349037fe..fe8073def403 100644 --- a/dom/ipc/tests/JSWindowActor/browser.ini +++ b/dom/ipc/tests/JSWindowActor/browser.ini @@ -10,7 +10,6 @@ support-files = support-files= file_mediaPlayback.html audio.ogg -[browser_process_childid.js] [browser_registerWindowActor.js] [browser_sendAsyncMessage.js] [browser_sendQuery.js] diff --git a/dom/ipc/tests/JSWindowActor/browser_process_childid.js b/dom/ipc/tests/JSWindowActor/browser_process_childid.js deleted file mode 100644 index 076419ba0bb5..000000000000 --- a/dom/ipc/tests/JSWindowActor/browser_process_childid.js +++ /dev/null @@ -1,27 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ -"use strict"; - -// Test that `process.childID` is defined. - -declTest("test childid", { - async test(browser) { - let parent = browser.browsingContext.currentWindowGlobal; - ok( - parent.contentParent.childID, - "parent contentParent.childID should have a value." - ); - await SpecialPowers.spawn( - browser, - [parent.contentParent.childID], - async function(parentChildID) { - ok( - ChromeUtils.contentChild.childID, - "child process.childID should have a value." - ); - let childID = ChromeUtils.contentChild.childID; - is(parentChildID, childID); - } - ); - }, -});