1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_ParentProcessMessageManager_h
8 #define mozilla_dom_ParentProcessMessageManager_h
10 #include "mozilla/dom/MessageBroadcaster.h"
12 namespace mozilla::dom
{
15 * Implementation for the WebIDL ParentProcessMessageManager interface.
16 * ParentProcessMessageManager is used in a parent process to communicate with
17 * all the child processes.
19 class ParentProcessMessageManager final
: public MessageBroadcaster
{
21 ParentProcessMessageManager();
23 virtual JSObject
* WrapObject(JSContext
* aCx
,
24 JS::Handle
<JSObject
*> aGivenProto
) override
;
26 // ProcessScriptLoader
27 void LoadProcessScript(const nsAString
& aUrl
, bool aAllowDelayedLoad
,
28 mozilla::ErrorResult
& aError
) {
29 LoadScript(aUrl
, aAllowDelayedLoad
, false, aError
);
31 void RemoveDelayedProcessScript(const nsAString
& aURL
) {
32 RemoveDelayedScript(aURL
);
34 void GetDelayedProcessScripts(JSContext
* aCx
,
35 nsTArray
<nsTArray
<JS::Value
>>& aScripts
,
36 mozilla::ErrorResult
& aError
) {
37 GetDelayedScripts(aCx
, aScripts
, aError
);
40 // GlobalProcessScriptLoader
41 using nsFrameMessageManager::GetInitialProcessData
;
44 virtual ~ParentProcessMessageManager();
47 } // namespace mozilla::dom
49 #endif // mozilla_dom_ParentProcessMessageManager_h