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_ProcessMessageManager_h
8 #define mozilla_dom_ProcessMessageManager_h
10 #include "mozilla/dom/MessageSender.h"
15 class ParentProcessMessageManager
;
18 * ProcessMessageManager is used in a parent process to communicate with a child
19 * process (or with the process itself in a single-process scenario).
21 class ProcessMessageManager final
: public MessageSender
{
23 ProcessMessageManager(
24 ipc::MessageManagerCallback
* aCallback
,
25 ParentProcessMessageManager
* aParentManager
,
26 MessageManagerFlags aFlags
= MessageManagerFlags::MM_NONE
);
28 virtual JSObject
* WrapObject(JSContext
* aCx
,
29 JS::Handle
<JSObject
*> aGivenProto
) override
;
31 // ProcessScriptLoader
32 void LoadProcessScript(const nsAString
& aUrl
, bool aAllowDelayedLoad
,
33 mozilla::ErrorResult
& aError
) {
34 LoadScript(aUrl
, aAllowDelayedLoad
, false, aError
);
36 void RemoveDelayedProcessScript(const nsAString
& aURL
) {
37 RemoveDelayedScript(aURL
);
39 void GetDelayedProcessScripts(JSContext
* aCx
,
40 nsTArray
<nsTArray
<JS::Value
>>& aScripts
,
41 mozilla::ErrorResult
& aError
) {
42 GetDelayedScripts(aCx
, aScripts
, aError
);
47 } // namespace mozilla
49 #endif // mozilla_dom_ProcessMessageManager_h