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_ChildProcessMessageManager_h
8 #define mozilla_dom_ChildProcessMessageManager_h
10 #include "mozilla/dom/SyncMessageSender.h"
11 #include "mozilla/dom/MessageManagerBinding.h"
12 #include "mozilla/HoldDropJSObjects.h"
14 namespace mozilla::dom
{
16 class ChildProcessMessageManager final
: public SyncMessageSender
{
18 explicit ChildProcessMessageManager(ipc::MessageManagerCallback
* aCallback
)
19 : SyncMessageSender(aCallback
, MessageManagerFlags::MM_PROCESSMANAGER
|
20 MessageManagerFlags::MM_OWNSCALLBACK
) {
21 mozilla::HoldJSObjects(this);
24 virtual JSObject
* WrapObject(JSContext
* aCx
,
25 JS::Handle
<JSObject
*> aGivenProto
) override
{
26 return ChildProcessMessageManager_Binding::Wrap(aCx
, this, aGivenProto
);
30 virtual ~ChildProcessMessageManager() { mozilla::DropJSObjects(this); }
33 } // namespace mozilla::dom
35 #endif // mozilla_dom_ChildProcessMessageManager_h