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 #include "mozilla/dom/MessageBroadcaster.h"
8 #include "mozilla/dom/ContentParent.h"
13 MessageBroadcaster::MessageBroadcaster(MessageBroadcaster
* aParentManager
,
14 MessageManagerFlags aFlags
)
15 : MessageListenerManager(nullptr, aParentManager
,
16 aFlags
| MessageManagerFlags::MM_BROADCASTER
) {
18 aParentManager
->AddChildManager(this);
22 void MessageBroadcaster::ReleaseCachedProcesses() {
23 ContentParent::ReleaseCachedProcesses();
26 void MessageBroadcaster::AddChildManager(MessageListenerManager
* aManager
) {
27 mChildManagers
.AppendElement(aManager
);
29 RefPtr
<nsFrameMessageManager
> kungfuDeathGrip
= this;
30 RefPtr
<nsFrameMessageManager
> kungfuDeathGrip2
= aManager
;
32 LoadPendingScripts(this, aManager
);
35 void MessageBroadcaster::RemoveChildManager(MessageListenerManager
* aManager
) {
36 mChildManagers
.RemoveElement(aManager
);
40 } // namespace mozilla