diff --git a/dom/base/ProcessGlobal.cpp b/dom/base/ProcessGlobal.cpp index 66f45d8d6088..e7850f9a6219 100644 --- a/dom/base/ProcessGlobal.cpp +++ b/dom/base/ProcessGlobal.cpp @@ -59,7 +59,7 @@ ProcessGlobal::GetOwnPropertyNames(JSContext* aCx, JS::AutoIdVector& aNames, ProcessGlobal* ProcessGlobal::Get() { - nsCOMPtr service = do_GetService(NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID); + nsCOMPtr service = do_GetService(NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID); if (!service) { return nullptr; } @@ -96,10 +96,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ProcessGlobal) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISyncMessageSender) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIMessageSender) NS_INTERFACE_MAP_ENTRY(nsIMessageListenerManager) NS_INTERFACE_MAP_ENTRY(nsIMessageSender) - NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) NS_INTERFACE_MAP_ENTRY(nsIGlobalObject) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) diff --git a/dom/base/ProcessGlobal.h b/dom/base/ProcessGlobal.h index ed6d0fc27948..1bde550c7283 100644 --- a/dom/base/ProcessGlobal.h +++ b/dom/base/ProcessGlobal.h @@ -26,7 +26,7 @@ namespace mozilla { namespace dom { class ProcessGlobal : - public nsISyncMessageSender, + public nsIMessageSender, public nsMessageManagerScriptExecutor, public nsIGlobalObject, public nsIScriptObjectPrincipal, @@ -52,7 +52,7 @@ public: static ProcessGlobal* Get(); NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(ProcessGlobal, nsISyncMessageSender) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(ProcessGlobal, nsIMessageSender) virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override @@ -70,8 +70,6 @@ public: using MessageManagerGlobal::SendAsyncMessage; using MessageManagerGlobal::GetProcessMessageManager; using MessageManagerGlobal::GetRemoteType; - using MessageManagerGlobal::SendSyncMessage; - using MessageManagerGlobal::SendRpcMessage; // ContentProcessMessageManager void GetInitialProcessData(JSContext* aCx, @@ -87,7 +85,6 @@ public: NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager) NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager) - NS_FORWARD_SAFE_NSISYNCMESSAGESENDER(mMessageManager) virtual void LoadScript(const nsAString& aURL); diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index 1b599fcadfcf..e1d7d734ed8c 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -143,11 +143,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameMessageManager) static_cast( static_cast(this)))) - /* Message managers in child process implement nsIMessageSender and - nsISyncMessageSender. Message managers in the chrome process are + /* Message managers in child process implement nsIMessageSender. + Message managers in the chrome process are either broadcasters (if they have subordinate/child message managers) or they're simple message senders. */ - NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsISyncMessageSender, !mChrome) NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIMessageSender, !mChrome || !mIsBroadcaster) NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIMessageBroadcaster, mChrome && mIsBroadcaster) @@ -530,36 +529,9 @@ GetParamsForMessage(JSContext* aCx, return true; } -// nsISyncMessageSender static bool sSendingSyncMessage = false; -NS_IMETHODIMP -nsFrameMessageManager::SendSyncMessage(const nsAString& aMessageName, - JS::Handle aJSON, - JS::Handle aObjects, - nsIPrincipal* aPrincipal, - JSContext* aCx, - uint8_t aArgc, - JS::MutableHandle aRetval) -{ - return SendMessage(aMessageName, aJSON, aObjects, aPrincipal, aCx, aArgc, - aRetval, true); -} - -NS_IMETHODIMP -nsFrameMessageManager::SendRpcMessage(const nsAString& aMessageName, - JS::Handle aJSON, - JS::Handle aObjects, - nsIPrincipal* aPrincipal, - JSContext* aCx, - uint8_t aArgc, - JS::MutableHandle aRetval) -{ - return SendMessage(aMessageName, aJSON, aObjects, aPrincipal, aCx, aArgc, - aRetval, false); -} - static bool AllowMessage(size_t aDataLength, const nsAString& aMessageName) { @@ -580,53 +552,6 @@ AllowMessage(size_t aDataLength, const nsAString& aMessageName) return false; } -nsresult -nsFrameMessageManager::SendMessage(const nsAString& aMessageName, - JS::Handle aJSON, - JS::Handle aObjects, - nsIPrincipal* aPrincipal, - JSContext* aCx, - uint8_t aArgc, - JS::MutableHandle aRetval, - bool aIsSync) -{ - AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsFrameMessageManager::SendMessage", EVENTS, aMessageName); - - aRetval.setUndefined(); - - if (sSendingSyncMessage && aIsSync) { - // No kind of blocking send should be issued on top of a sync message. - return NS_ERROR_UNEXPECTED; - } - - StructuredCloneData data; - if (aArgc >= 2 && !GetParamsForMessage(aCx, aJSON, JS::UndefinedHandleValue, data)) { - return NS_ERROR_DOM_DATA_CLONE_ERR; - } - - JS::Rooted objects(aCx); - if (aArgc >= 3 && aObjects.isObject()) { - objects = &aObjects.toObject(); - } - - nsTArray result; - SequenceRooter resultRooter(aCx, &result); - ErrorResult rv; - SendMessage(aCx, aMessageName, data, objects, aPrincipal, aIsSync, result, rv); - rv.WouldReportJSException(); - if (rv.Failed()) { - return rv.StealNSResult(); - } - - JS::Rooted dataArray(aCx); - if (!ToJSValue(aCx, result, aRetval)) { - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - void nsFrameMessageManager::SendMessage(JSContext* aCx, const nsAString& aMessageName, @@ -1976,7 +1901,7 @@ nsFrameMessageManager::NewProcessMessageManager(bool aIsRemote) } nsresult -NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult) +NS_NewChildProcessMessageManager(nsIMessageSender** aResult) { NS_ASSERTION(!nsFrameMessageManager::GetChildProcessManager(), "Re-creating sChildProcessManager"); diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h index 78b806a24ed2..a76b2a2e7dd0 100644 --- a/dom/base/nsFrameMessageManager.h +++ b/dom/base/nsFrameMessageManager.h @@ -253,7 +253,6 @@ public: NS_DECL_NSIMESSAGELISTENERMANAGER NS_DECL_NSIMESSAGESENDER NS_DECL_NSIMESSAGEBROADCASTER - NS_DECL_NSISYNCMESSAGESENDER NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER static mozilla::dom::ChromeMessageSender* diff --git a/dom/base/nsIMessageManager.idl b/dom/base/nsIMessageManager.idl index d605c0f29041..c69a506371d0 100644 --- a/dom/base/nsIMessageManager.idl +++ b/dom/base/nsIMessageManager.idl @@ -346,38 +346,8 @@ interface nsIMessageBroadcaster : nsIMessageListenerManager void releaseCachedProcesses(); }; -[uuid(0e602c9e-1977-422a-a8e4-fe0d4a4f78d0)] -interface nsISyncMessageSender : nsIMessageSender -{ - /** - * Like |sendAsyncMessage()|, except blocks the sender until all - * listeners of the message have been invoked. Returns an array - * containing return values from each listener invoked. - */ - [implicit_jscontext, optional_argc] - jsval sendSyncMessage([optional] in AString messageName, - [optional] in jsval obj, - [optional] in jsval objects, - [optional] in nsIPrincipal principal); - - /** - * Like |sendSyncMessage()|, except re-entrant. New RPC messages may be - * issued even if, earlier on the call stack, we are waiting for a reply - * to an earlier sendRpcMessage() call. - * - * Both sendSyncMessage and sendRpcMessage will block until a reply is - * received, but they may be temporarily interrupted to process an urgent - * incoming message (such as a CPOW request). - */ - [implicit_jscontext, optional_argc] - jsval sendRpcMessage([optional] in AString messageName, - [optional] in jsval obj, - [optional] in jsval objects, - [optional] in nsIPrincipal principal); -}; - [uuid(694e367c-aa25-4446-8499-2c527c4bd838)] -interface nsIContentFrameMessageManager : nsISyncMessageSender +interface nsIContentFrameMessageManager : nsIMessageSender { }; diff --git a/dom/base/nsInProcessTabChildGlobal.cpp b/dom/base/nsInProcessTabChildGlobal.cpp index 07b601d06d88..e0a6f5687841 100644 --- a/dom/base/nsInProcessTabChildGlobal.cpp +++ b/dom/base/nsInProcessTabChildGlobal.cpp @@ -162,7 +162,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsInProcessTabChildGlobal) NS_INTERFACE_MAP_ENTRY(nsIMessageListenerManager) NS_INTERFACE_MAP_ENTRY(nsIMessageSender) - NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender) NS_INTERFACE_MAP_ENTRY(nsIContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIInProcessContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) diff --git a/dom/base/nsInProcessTabChildGlobal.h b/dom/base/nsInProcessTabChildGlobal.h index 4eefffe23254..98abf7a9535e 100644 --- a/dom/base/nsInProcessTabChildGlobal.h +++ b/dom/base/nsInProcessTabChildGlobal.h @@ -68,7 +68,6 @@ public: NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager) NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager) - NS_FORWARD_SAFE_NSISYNCMESSAGESENDER(mMessageManager); NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER NS_DECL_NSIINPROCESSCONTENTFRAMEMESSAGEMANAGER diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index ac8a39904a08..b8007b0087bb 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -3517,7 +3517,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TabChildGlobal) NS_INTERFACE_MAP_ENTRY(nsIMessageListenerManager) NS_INTERFACE_MAP_ENTRY(nsIMessageSender) - NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender) NS_INTERFACE_MAP_ENTRY(nsIContentFrameMessageManager) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) NS_INTERFACE_MAP_ENTRY(nsIGlobalObject) diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 11545d41d274..33da760d97fc 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -106,7 +106,6 @@ public: NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager) NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager) - NS_FORWARD_SAFE_NSISYNCMESSAGESENDER(mMessageManager); NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER nsresult diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index d80550e5b46e..456956b22020 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -320,7 +320,7 @@ nsresult NS_NewContentPolicy(nsIContentPolicy** aResult); nsresult NS_NewEventListenerService(nsIEventListenerService** aResult); nsresult NS_NewGlobalMessageManager(nsIMessageBroadcaster** aResult); nsresult NS_NewParentProcessMessageManager(nsIMessageBroadcaster** aResult); -nsresult NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult); +nsresult NS_NewChildProcessMessageManager(nsIMessageSender** aResult); nsresult NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult); @@ -398,7 +398,7 @@ MAKE_CTOR(CreateContentDLF, nsIDocumentLoaderFactory, NS_NewCon MAKE_CTOR(CreateEventListenerService, nsIEventListenerService, NS_NewEventListenerService) MAKE_CTOR(CreateGlobalMessageManager, nsIMessageBroadcaster, NS_NewGlobalMessageManager) MAKE_CTOR(CreateParentMessageManager, nsIMessageBroadcaster, NS_NewParentProcessMessageManager) -MAKE_CTOR(CreateChildMessageManager, nsISyncMessageSender, NS_NewChildProcessMessageManager) +MAKE_CTOR(CreateChildMessageManager, nsIMessageSender, NS_NewChildProcessMessageManager) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDataDocumentContentPolicy) NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoDataProtocolContentPolicy) MAKE_CTOR(CreatePluginDocument, nsIDocument, NS_NewPluginDocument)