2017-06-14 17:44:17 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_MessageListenerManager_h
|
|
|
|
#define mozilla_dom_MessageListenerManager_h
|
|
|
|
|
|
|
|
#include "nsCycleCollectionNoteChild.h"
|
|
|
|
#include "nsFrameMessageManager.h"
|
2017-06-20 12:09:50 +03:00
|
|
|
#include "nsWrapperCache.h"
|
2017-06-14 17:44:17 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-04-16 16:18:48 +03:00
|
|
|
class MessageBroadcaster;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation for the WebIDL MessageListenerManager interface. Base class
|
|
|
|
* for message managers that are exposed to script.
|
|
|
|
*/
|
2017-06-20 12:09:50 +03:00
|
|
|
class MessageListenerManager : public nsFrameMessageManager,
|
|
|
|
public nsWrapperCache {
|
2017-06-14 17:44:17 +03:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2017-06-20 12:09:50 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageListenerManager,
|
|
|
|
nsFrameMessageManager)
|
|
|
|
|
2018-04-16 16:18:48 +03:00
|
|
|
MessageBroadcaster* GetParentObject() { return mParentManager; }
|
2017-06-14 17:44:17 +03:00
|
|
|
|
2018-04-16 16:18:48 +03:00
|
|
|
virtual MessageBroadcaster* GetParentManager() override {
|
2017-06-14 17:44:17 +03:00
|
|
|
return mParentManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If aRemove is true then RemoveChildManager(this) will be called on the
|
|
|
|
* parent manager first.
|
|
|
|
*/
|
|
|
|
virtual void ClearParentManager(bool aRemove) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
MessageListenerManager(ipc::MessageManagerCallback* aCallback,
|
2018-04-16 16:18:48 +03:00
|
|
|
MessageBroadcaster* aParentManager,
|
2017-06-14 17:44:17 +03:00
|
|
|
MessageManagerFlags aFlags);
|
|
|
|
virtual ~MessageListenerManager();
|
|
|
|
|
2018-04-16 16:18:48 +03:00
|
|
|
RefPtr<MessageBroadcaster> mParentManager;
|
2017-06-14 17:44:17 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_MessageListenerManager_h
|