From 37754ca52c071edd02e6966425642a81d07bafcc Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Tue, 31 Aug 2010 11:58:35 -0700 Subject: [PATCH] Bug 585173 - Process message manager. r=dougt a=blocking-fennec --- content/base/public/nsContentCID.h | 14 ++ .../base/public/nsIFrameMessageManager.idl | 12 +- content/base/src/nsFrameMessageManager.cpp | 122 +++++++++++++++++- content/base/src/nsFrameMessageManager.h | 32 ++++- .../base/src/nsInProcessTabChildGlobal.cpp | 1 + dom/base/nsDOMClassInfo.cpp | 1 + dom/ipc/ContentChild.cpp | 13 ++ dom/ipc/ContentChild.h | 5 +- dom/ipc/ContentParent.cpp | 26 ++++ dom/ipc/ContentParent.h | 4 + dom/ipc/PContent.ipdl | 7 + dom/ipc/TabChild.cpp | 1 + dom/ipc/remote-test.js | 9 ++ dom/ipc/test.xul | 28 +++- layout/build/nsLayoutModule.cpp | 10 ++ 15 files changed, 271 insertions(+), 14 deletions(-) diff --git a/content/base/public/nsContentCID.h b/content/base/public/nsContentCID.h index 64c9a1f4ba2..86d657e6353 100644 --- a/content/base/public/nsContentCID.h +++ b/content/base/public/nsContentCID.h @@ -315,6 +315,20 @@ #define NS_GLOBALMESSAGEMANAGER_CONTRACTID \ "@mozilla.org/globalmessagemanager;1" +#define NS_PARENTPROCESSMESSAGEMANAGER_CID \ + { /* 2a058404-fb85-44ec-8cfd-e8cbdc988dc1 */ \ + 0x2a058404, 0xfb85, 0x44ec, \ + { 0x8c, 0xfd, 0xe8, 0xcb, 0xdc, 0x98, 0x8d, 0xc1 } } +#define NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID \ + "@mozilla.org/parentprocessmessagemanager;1" + + #define NS_CHILDPROCESSMESSAGEMANAGER_CID \ + { /* fe0ff7c3-8e97-448b-9a8a-86afdb9fbbb6 */ \ + 0xfe0ff7c3, 0x8e97, 0x448b, \ + { 0x9a, 0x8a, 0x86, 0xaf, 0xdb, 0x9f, 0xbb, 0xb6 } } +#define NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID \ + "@mozilla.org/childprocessmessagemanager;1" + // {f96f5ec9-755b-447e-b1f3-717d1a84bb41} #define NS_PLUGINDOCUMENT_CID \ { 0xf96f5ec9, 0x755b, 0x447e, { 0xb1, 0xf3, 0x71, 0x7d, 0x1a, 0x84, 0xbb, 0x41 } } diff --git a/content/base/public/nsIFrameMessageManager.idl b/content/base/public/nsIFrameMessageManager.idl index eef42ce591f..4f0f0320d15 100644 --- a/content/base/public/nsIFrameMessageManager.idl +++ b/content/base/public/nsIFrameMessageManager.idl @@ -72,16 +72,18 @@ interface nsIFrameMessageManager : nsISupports void sendAsyncMessage(/*in messageName, in JSON*/); }; -[scriptable, uuid(c56e85b8-6736-4ae2-ae90-66bcef952a82)] -interface nsIContentFrameMessageManager : nsIFrameMessageManager +[scriptable, uuid(cdb1a40b-9862-426c-ae8a-f5ab84e20e32)] +interface nsISyncMessageSender : nsIFrameMessageManager { /** - * @note sending JS objects isn't implemented yet. - * * Returns an array of JSON objects. */ - void sendSyncMessage(/*in messageName, in JSON, in an array of JS objects,*/); + void sendSyncMessage(/*in messageName, in JSON*/); +}; +[scriptable, uuid(c56e85b8-6736-4ae2-ae90-66bcef952a82)] +interface nsIContentFrameMessageManager : nsISyncMessageSender +{ /** * The current top level window in the frame or null. */ diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index d6d292f6b62..3ddee3b610f 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -35,6 +35,10 @@ * * ***** END LICENSE BLOCK ***** */ +#ifdef MOZ_IPC +#include "ContentChild.h" +#include "ContentParent.h" +#endif #include "jscntxt.h" #include "nsFrameMessageManager.h" #include "nsContentUtils.h" @@ -46,6 +50,17 @@ #include "nsNetUtil.h" #include "nsScriptLoader.h" #include "nsIJSContextStack.h" +#include "nsIXULRuntime.h" + +static PRBool +IsChromeProcess() +{ + nsCOMPtr rt = do_GetService("@mozilla.org/xre/runtime;1"); + NS_ABORT_IF_FALSE(rt, "We must have a xre runtime"); + PRUint32 type; + rt->GetProcessType(&type); + return type == nsIXULRuntime::PROCESS_TYPE_DEFAULT; +} NS_IMPL_CYCLE_COLLECTION_CLASS(nsFrameMessageManager) @@ -76,8 +91,14 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameMessageManager) static_cast(this)) : static_cast( static_cast(this)))) - NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIContentFrameMessageManager, !mChrome) - NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIChromeFrameMessageManager, mChrome) + /* nsIContentFrameMessageManager is accessible only in TabChildGlobal. */ + NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIContentFrameMessageManager, + !mChrome && !mIsProcessManager) + /* Message managers in child process support nsISyncMessageSender. */ + NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsISyncMessageSender, !mChrome) + /* Process message manager doesn't support nsIChromeFrameMessageManager. */ + NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIChromeFrameMessageManager, + mChrome && !mIsProcessManager) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsFrameMessageManager, @@ -307,6 +328,9 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget, JSContext* aContext) { JSContext* ctx = mContext ? mContext : aContext; + if (!ctx) { + nsContentUtils::ThreadJSContextStack()->GetSafeJSContext(&ctx); + } if (mListeners.Length()) { nsCOMPtr name = do_GetAtom(aMessage); nsRefPtr kungfuDeathGrip(this); @@ -496,6 +520,7 @@ nsFrameMessageManager::Disconnect(PRBool aRemoveFromParent) nsresult NS_NewGlobalMessageManager(nsIChromeFrameMessageManager** aResult) { + NS_ENSURE_TRUE(IsChromeProcess(), NS_ERROR_NOT_AVAILABLE); nsFrameMessageManager* mm = new nsFrameMessageManager(PR_TRUE, nsnull, nsnull, @@ -681,3 +706,96 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL) NS_IMPL_ISUPPORTS1(nsScriptCacheCleaner, nsIObserver) +nsFrameMessageManager* nsFrameMessageManager::sChildProcessManager = nsnull; +nsFrameMessageManager* nsFrameMessageManager::sParentProcessManager = nsnull; + +#ifdef MOZ_IPC +bool SendAsyncMessageToChildProcess(void* aCallbackData, + const nsAString& aMessage, + const nsAString& aJSON) +{ + mozilla::dom::ContentParent* cp = + mozilla::dom::ContentParent::GetSingleton(PR_FALSE); + NS_WARN_IF_FALSE(cp, "No child process!"); + if (cp) { + return cp->SendAsyncMessage(nsString(aMessage), nsString(aJSON)); + } + return true; +} + +bool SendSyncMessageToParentProcess(void* aCallbackData, + const nsAString& aMessage, + const nsAString& aJSON, + nsTArray* aJSONRetVal) +{ + mozilla::dom::ContentChild* cc = + mozilla::dom::ContentChild::GetSingleton(); + if (cc) { + return + cc->SendSyncMessage(nsString(aMessage), nsString(aJSON), aJSONRetVal); + } + return true; +} + +bool SendAsyncMessageToParentProcess(void* aCallbackData, + const nsAString& aMessage, + const nsAString& aJSON) +{ + mozilla::dom::ContentChild* cc = + mozilla::dom::ContentChild::GetSingleton(); + if (cc) { + return cc->SendAsyncMessage(nsString(aMessage), nsString(aJSON)); + } + return true; +} + +#endif + +nsresult +NS_NewParentProcessMessageManager(nsIFrameMessageManager** aResult) +{ + NS_ASSERTION(!nsFrameMessageManager::sParentProcessManager, + "Re-creating sParentProcessManager"); +#ifdef MOZ_IPC + NS_ENSURE_TRUE(IsChromeProcess(), NS_ERROR_NOT_AVAILABLE); + nsFrameMessageManager* mm = new nsFrameMessageManager(PR_TRUE, + nsnull, + SendAsyncMessageToChildProcess, + nsnull, + &nsFrameMessageManager::sParentProcessManager, + nsnull, + nsnull, + PR_FALSE, + PR_TRUE); + NS_ENSURE_TRUE(mm, NS_ERROR_OUT_OF_MEMORY); + nsFrameMessageManager::sParentProcessManager = mm; + return CallQueryInterface(mm, aResult); +#else + return NS_ERROR_NOT_AVAILABLE; +#endif +} + + +nsresult +NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult) +{ + NS_ASSERTION(!nsFrameMessageManager::sChildProcessManager, + "Re-creating sChildProcessManager"); +#ifdef MOZ_IPC + NS_ENSURE_TRUE(!IsChromeProcess(), NS_ERROR_NOT_AVAILABLE); + nsFrameMessageManager* mm = new nsFrameMessageManager(PR_FALSE, + SendSyncMessageToParentProcess, + SendAsyncMessageToParentProcess, + nsnull, + &nsFrameMessageManager::sChildProcessManager, + nsnull, + nsnull, + PR_FALSE, + PR_TRUE); + NS_ENSURE_TRUE(mm, NS_ERROR_OUT_OF_MEMORY); + nsFrameMessageManager::sChildProcessManager = mm; + return CallQueryInterface(mm, aResult); +#else + return NS_ERROR_NOT_AVAILABLE; +#endif +} diff --git a/content/base/src/nsFrameMessageManager.h b/content/base/src/nsFrameMessageManager.h index 37c30d92e9a..36f4374f269 100644 --- a/content/base/src/nsFrameMessageManager.h +++ b/content/base/src/nsFrameMessageManager.h @@ -82,14 +82,16 @@ public: void* aCallbackData, nsFrameMessageManager* aParentManager, JSContext* aContext, - PRBool aGlobal = PR_FALSE) - : mChrome(aChrome), mGlobal(aGlobal), mParentManager(aParentManager), + PRBool aGlobal = PR_FALSE, + PRBool aProcessManager = PR_FALSE) + : mChrome(aChrome), mGlobal(aGlobal), mIsProcessManager(aProcessManager), + mParentManager(aParentManager), mSyncCallback(aSyncCallback), mAsyncCallback(aAsyncCallback), mLoadScriptCallback(aLoadScriptCallback), mCallbackData(aCallbackData), mContext(aContext) { - NS_ASSERTION(mContext || (aChrome && !aParentManager), - "Should have mContext in non-global manager!"); + NS_ASSERTION(mContext || (aChrome && !aParentManager) || aProcessManager, + "Should have mContext in non-global/non-process manager!"); NS_ASSERTION(aChrome || !aParentManager, "Should not set parent manager!"); // This is a bit hackish. When parent manager is global, we want // to attach the window message manager to it immediately. @@ -106,12 +108,21 @@ public: static_cast(mChildManagers[i - 1])-> Disconnect(PR_FALSE); } + if (mIsProcessManager) { + if (this == sParentProcessManager) { + sParentProcessManager = nsnull; + } + if (this == sChildProcessManager) { + sChildProcessManager = nsnull; + } + } } NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameMessageManager, nsIContentFrameMessageManager) NS_DECL_NSIFRAMEMESSAGEMANAGER + NS_DECL_NSISYNCMESSAGESENDER NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER NS_DECL_NSICHROMEFRAMEMESSAGEMANAGER @@ -142,11 +153,21 @@ public: } PRBool IsGlobal() { return mGlobal; } PRBool IsWindowLevel() { return mParentManager && mParentManager->IsGlobal(); } + + static nsFrameMessageManager* GetParentProcessManager() + { + return sParentProcessManager; + } + static nsFrameMessageManager* GetChildProcessManager() + { + return sChildProcessManager; + } protected: nsTArray mListeners; nsCOMArray mChildManagers; PRPackedBool mChrome; PRPackedBool mGlobal; + PRPackedBool mIsProcessManager; nsFrameMessageManager* mParentManager; nsSyncMessageCallback mSyncCallback; nsAsyncMessageCallback mAsyncCallback; @@ -154,6 +175,9 @@ protected: void* mCallbackData; JSContext* mContext; nsTArray mPendingScripts; +public: + static nsFrameMessageManager* sParentProcessManager; + static nsFrameMessageManager* sChildProcessManager; }; class nsScriptCacheCleaner; diff --git a/content/base/src/nsInProcessTabChildGlobal.cpp b/content/base/src/nsInProcessTabChildGlobal.cpp index 0e56b8745d4..ac4b590b471 100644 --- a/content/base/src/nsInProcessTabChildGlobal.cpp +++ b/content/base/src/nsInProcessTabChildGlobal.cpp @@ -153,6 +153,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsInProcessTabChildGlobal) NS_INTERFACE_MAP_ENTRY(nsIFrameMessageManager) + NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender) NS_INTERFACE_MAP_ENTRY(nsIContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIInProcessContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIScriptContextPrincipal) diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 0f05ac6aabb..fb392572f97 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -4035,6 +4035,7 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIFrameMessageManager) + DOM_CLASSINFO_MAP_ENTRY(nsISyncMessageSender) DOM_CLASSINFO_MAP_ENTRY(nsIContentFrameMessageManager) DOM_CLASSINFO_MAP_END diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 6f17a16f708..011566f6af4 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -63,6 +63,7 @@ #include "nsChromeRegistryContent.h" #include "mozilla/chrome/RegistryMessageUtils.h" +#include "nsFrameMessageManager.h" using namespace mozilla::ipc; using namespace mozilla::net; @@ -356,5 +357,17 @@ ContentChild::RecvNotifyVisited(const IPC::URI& aURI) return true; } + +bool +ContentChild::RecvAsyncMessage(const nsString& aMsg, const nsString& aJSON) +{ + nsRefPtr cpm = nsFrameMessageManager::sChildProcessManager; + if (cpm) { + cpm->ReceiveMessage(static_cast(cpm.get()), + aMsg, PR_FALSE, aJSON, nsnull, nsnull); + } + return true; +} + } // namespace dom } // namespace mozilla diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 73dca743003..08e37055e7a 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -101,8 +101,9 @@ public: const nsCString& aPrefRoot, nsIObserver* aObserver); - virtual bool RecvNotifyRemotePrefObserver( - const nsCString& aDomain); + virtual bool RecvNotifyRemotePrefObserver(const nsCString& aDomain); + + virtual bool RecvAsyncMessage(const nsString& aMsg, const nsString& aJSON); private: NS_OVERRIDE diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 0d898f88bc8..2ce5f1fdba1 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -55,6 +55,7 @@ #include "nsChromeRegistryChrome.h" #include "nsExternalHelperAppService.h" #include "nsCExternalHandlerService.h" +#include "nsFrameMessageManager.h" #ifdef ANDROID #include "AndroidBridge.h" @@ -556,6 +557,31 @@ ContentParent::RecvNotifyIME(const int& aType, const int& aStatus) return false; #endif } + + +bool +ContentParent::RecvSyncMessage(const nsString& aMsg, const nsString& aJSON, + nsTArray* aRetvals) +{ + nsRefPtr ppm = nsFrameMessageManager::sParentProcessManager; + if (ppm) { + ppm->ReceiveMessage(static_cast(ppm.get()), + aMsg,PR_TRUE, aJSON, nsnull, aRetvals); + } + return true; +} + + +bool +ContentParent::RecvAsyncMessage(const nsString& aMsg, const nsString& aJSON) +{ + nsRefPtr ppm = nsFrameMessageManager::sParentProcessManager; + if (ppm) { + ppm->ReceiveMessage(static_cast(ppm.get()), + aMsg, PR_FALSE, aJSON, nsnull, nsnull); + } + return true; +} } // namespace dom } // namespace mozilla diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index d6daab20264..0a36c1e2cd5 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -164,6 +164,10 @@ private: virtual bool RecvLoadURIExternal(const IPC::URI& uri); + virtual bool RecvSyncMessage(const nsString& aMsg, const nsString& aJSON, + nsTArray* aRetvals); + virtual bool RecvAsyncMessage(const nsString& aMsg, const nsString& aJSON); + mozilla::Monitor mMonitor; GeckoChildProcessHost* mSubprocess; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 8e878aad391..fef4cd5c4db 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -98,6 +98,13 @@ parent: NotifyIME(int aType, int aState); NotifyIMEChange(nsString aText, PRUint32 aTextLen, int aStart, int aEnd, int aNewEnd); + + sync SyncMessage(nsString aMessage, nsString aJSON) + returns (nsString[] retval); + +both: + AsyncMessage(nsString aMessage, nsString aJSON); + }; } diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 9ad99243035..bfd4ce3e6e7 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1193,6 +1193,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TabChildGlobal) NS_INTERFACE_MAP_ENTRY(nsIFrameMessageManager) + NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender) NS_INTERFACE_MAP_ENTRY(nsIContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIScriptContextPrincipal) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) diff --git a/dom/ipc/remote-test.js b/dom/ipc/remote-test.js index ead67d65b91..af54e363ff4 100644 --- a/dom/ipc/remote-test.js +++ b/dom/ipc/remote-test.js @@ -1,6 +1,15 @@ dump("Loading remote script!\n"); dump(content + "\n"); +var cpm = Components.classes["@mozilla.org/childprocessmessagemanager;1"] + .getService(Components.interfaces.nsISyncMessageSender); +cpm.addMessageListener("cpm-async", + function(m) { + cpm.sendSyncMessage("ppm-sync"); + dump(content.document.documentElement); + cpm.sendAsyncMessage("ppm-async"); + }); + var Cc = Components.classes; var Ci = Components.interfaces; var dshell = content.QueryInterface(Ci.nsIInterfaceRequestor) diff --git a/dom/ipc/test.xul b/dom/ipc/test.xul index 1b827711392..6d36406e8e4 100644 --- a/dom/ipc/test.xul +++ b/dom/ipc/test.xul @@ -92,8 +92,34 @@ } function initRemoteFrameScript() { - // 1. Test that loading a script works + // 1. Test that loading a script works, and that accessing process level mm and + // global mm works. + var ppm = Components.classes["@mozilla.org/parentprocessmessagemanager;1"] + .getService(Components.interfaces.nsIFrameMessageManager); + var gm = Components.classes["@mozilla.org/globalmessagemanager;1"] + .getService(Components.interfaces.nsIChromeFrameMessageManager); + var didThrow = false; + try { + var cpm = Components.classes["@mozilla.org/childprocessmessagemanager;1"] + .getService(Components.interfaces.nsISyncMessageSender); + } catch (ex) { + didThrow = true; + } + if (!didThrow) { + alert("One shouldn't be able to create content process message manager in chrome process!"); + } + ppm.addMessageListener("ppm-sync", + function(m) { + document.getElementById("messageLog").value += "[SYNC PPM]"; + } + ); + ppm.addMessageListener("ppm-async", + function(m) { + document.getElementById("messageLog").value += "[ASYNC PPM]"; + } + ); messageManager.loadFrameScript("chrome://global/content/remote-test-ipc.js", true); + ppm.sendAsyncMessage("cpm-async"); // 2. Test that adding message listener works, and that receiving a sync message works. messageManager.addMessageListener("linkclick", diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 25853f26f19..c647007b9ae 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -463,6 +463,8 @@ nsresult NS_NewDOMEventGroup(nsIDOMEventGroup** aResult); nsresult NS_NewEventListenerService(nsIEventListenerService** aResult); nsresult NS_NewGlobalMessageManager(nsIChromeFrameMessageManager** aResult); +nsresult NS_NewParentProcessMessageManager(nsIFrameMessageManager** aResult); +nsresult NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult); nsresult NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult); @@ -562,6 +564,8 @@ MAKE_CTOR(CreateXMLContentBuilder, nsIXMLContentBuilder, NS_NewXML MAKE_CTOR(CreateContentDLF, nsIDocumentLoaderFactory, NS_NewContentDocumentLoaderFactory) MAKE_CTOR(CreateEventListenerService, nsIEventListenerService, NS_NewEventListenerService) MAKE_CTOR(CreateGlobalMessageManager, nsIChromeFrameMessageManager,NS_NewGlobalMessageManager) +MAKE_CTOR(CreateParentMessageManager, nsIFrameMessageManager,NS_NewParentProcessMessageManager) +MAKE_CTOR(CreateChildMessageManager, nsISyncMessageSender,NS_NewChildProcessMessageManager) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWyciwygProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDataDocumentContentPolicy) NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoDataProtocolContentPolicy) @@ -868,6 +872,8 @@ NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS_CID); NS_DEFINE_NAMED_CID(CSPSERVICE_CID); NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID); NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_PARENTPROCESSMESSAGEMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSAGEMANAGER_CID); NS_DEFINE_NAMED_CID(NSCHANNELPOLICY_CID); NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID); NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID); @@ -1016,6 +1022,8 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kCSPSERVICE_CID, false, NULL, CSPServiceConstructor }, { &kNS_EVENTLISTENERSERVICE_CID, false, NULL, CreateEventListenerService }, { &kNS_GLOBALMESSAGEMANAGER_CID, false, NULL, CreateGlobalMessageManager }, + { &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, NULL, CreateParentMessageManager }, + { &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, NULL, CreateChildMessageManager }, { &kNSCHANNELPOLICY_CID, false, NULL, nsChannelPolicyConstructor }, { &kNS_SCRIPTSECURITYMANAGER_CID, false, NULL, Construct_nsIScriptSecurityManager }, { &kNS_PRINCIPAL_CID, false, NULL, nsPrincipalConstructor }, @@ -1158,6 +1166,8 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID }, { NS_EVENTLISTENERSERVICE_CONTRACTID, &kNS_EVENTLISTENERSERVICE_CID }, { NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID }, + { NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_PARENTPROCESSMESSAGEMANAGER_CID }, + { NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID }, { NSCHANNELPOLICY_CONTRACTID, &kNSCHANNELPOLICY_CID }, { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID }, { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },