gecko-dev/dom/base/ChromeMessageBroadcaster.cpp
Sebastian Hengst 3a10644021 Backed out 6 changesets (bug 888600) for beta simulation failures: build bustage on Linux and Windows opt (bug 1442036) and devtools failure browser_net_view-source-debugger.js (bug 1441961). a=backout
Backed out changeset 83c87140dc3d (bug 888600)
Backed out changeset 2efb9b1753f6 (bug 888600)
Backed out changeset af5303781961 (bug 888600)
Backed out changeset 79ef59047e63 (bug 888600)
Backed out changeset 30d568d628dd (bug 888600)
Backed out changeset c7bd4c6c9741 (bug 888600)

--HG--
extra : histedit_source : 791b22f6770f4fead2f909478a93d65d85829fe0%2Cbb387309e90f53e1dde45dcf8cf4ebedcc6e5c5e
2018-03-01 11:51:09 +02:00

48 lines
1.4 KiB
C++

/* -*- 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/. */
#include "mozilla/dom/ChromeMessageBroadcaster.h"
#include "AccessCheck.h"
#include "mozilla/HoldDropJSObjects.h"
#include "mozilla/dom/MessageManagerBinding.h"
namespace mozilla {
namespace dom {
ChromeMessageBroadcaster::ChromeMessageBroadcaster(nsFrameMessageManager* aParentManager,
MessageManagerFlags aFlags)
: MessageListenerManager(nullptr, aParentManager,
aFlags |
MessageManagerFlags::MM_BROADCASTER |
MessageManagerFlags::MM_CHROME)
{
if (mIsProcessManager) {
mozilla::HoldJSObjects(this);
}
if (aParentManager) {
aParentManager->AddChildManager(this);
}
}
ChromeMessageBroadcaster::~ChromeMessageBroadcaster()
{
if (mIsProcessManager) {
mozilla::DropJSObjects(this);
}
}
JSObject*
ChromeMessageBroadcaster::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
return ChromeMessageBroadcasterBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom
} // namespace mozilla