Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / MessageListenerManager.h
blobbc1043222c48a346a5b98c978918c7466f3b1159
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"
14 namespace mozilla::dom {
16 class MessageBroadcaster;
18 /**
19 * Implementation for the WebIDL MessageListenerManager interface. Base class
20 * for message managers that are exposed to script.
22 class MessageListenerManager : public nsFrameMessageManager,
23 public nsWrapperCache {
24 public:
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageListenerManager,
27 nsFrameMessageManager)
29 MessageBroadcaster* GetParentObject() { return mParentManager; }
31 virtual MessageBroadcaster* GetParentManager() override {
32 return mParentManager;
35 /**
36 * If aRemove is true then RemoveChildManager(this) will be called on the
37 * parent manager first.
39 virtual void ClearParentManager(bool aRemove) override;
41 protected:
42 MessageListenerManager(ipc::MessageManagerCallback* aCallback,
43 MessageBroadcaster* aParentManager,
44 MessageManagerFlags aFlags);
45 virtual ~MessageListenerManager();
47 RefPtr<MessageBroadcaster> mParentManager;
50 } // namespace mozilla::dom
52 #endif // mozilla_dom_MessageListenerManager_h