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_MessageListenerManager_h
8 #define mozilla_dom_MessageListenerManager_h
10 #include "nsCycleCollectionNoteChild.h"
11 #include "nsFrameMessageManager.h"
12 #include "nsWrapperCache.h"
17 class MessageBroadcaster
;
20 * Implementation for the WebIDL MessageListenerManager interface. Base class
21 * for message managers that are exposed to script.
23 class MessageListenerManager
: public nsFrameMessageManager
,
24 public nsWrapperCache
{
26 NS_DECL_ISUPPORTS_INHERITED
27 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageListenerManager
,
28 nsFrameMessageManager
)
30 MessageBroadcaster
* GetParentObject() { return mParentManager
; }
32 virtual MessageBroadcaster
* GetParentManager() override
{
33 return mParentManager
;
37 * If aRemove is true then RemoveChildManager(this) will be called on the
38 * parent manager first.
40 virtual void ClearParentManager(bool aRemove
) override
;
43 MessageListenerManager(ipc::MessageManagerCallback
* aCallback
,
44 MessageBroadcaster
* aParentManager
,
45 MessageManagerFlags aFlags
);
46 virtual ~MessageListenerManager();
48 RefPtr
<MessageBroadcaster
> mParentManager
;
52 } // namespace mozilla
54 #endif // mozilla_dom_MessageListenerManager_h