From 80d96f51177f24b6e9987126291d6228013dc0ef Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Fri, 6 Feb 2015 11:06:35 +0000 Subject: [PATCH] Bug 1130041 - UNIFIED_SOURCE for BroadcastChannel, r=smaug --- dom/broadcastchannel/BroadcastChannel.cpp | 14 +++++++------- dom/broadcastchannel/moz.build | 2 +- dom/events/MessageEvent.cpp | 6 ++++++ dom/events/MessageEvent.h | 5 +---- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dom/broadcastchannel/BroadcastChannel.cpp b/dom/broadcastchannel/BroadcastChannel.cpp index fbd103267b9..96b7c35123d 100644 --- a/dom/broadcastchannel/BroadcastChannel.cpp +++ b/dom/broadcastchannel/BroadcastChannel.cpp @@ -195,13 +195,13 @@ private: ErrorResult& mRv; }; -class PostMessageRunnable MOZ_FINAL : public nsICancelableRunnable +class BCPostMessageRunnable MOZ_FINAL : public nsICancelableRunnable { public: NS_DECL_ISUPPORTS - PostMessageRunnable(BroadcastChannelChild* aActor, - BroadcastChannelMessage* aData) + BCPostMessageRunnable(BroadcastChannelChild* aActor, + BroadcastChannelMessage* aData) : mActor(aActor) , mData(aData) { @@ -249,13 +249,13 @@ public: } private: - ~PostMessageRunnable() {} + ~BCPostMessageRunnable() {} nsRefPtr mActor; nsRefPtr mData; }; -NS_IMPL_ISUPPORTS(PostMessageRunnable, nsICancelableRunnable, nsIRunnable) +NS_IMPL_ISUPPORTS(BCPostMessageRunnable, nsICancelableRunnable, nsIRunnable) class CloseRunnable MOZ_FINAL : public nsICancelableRunnable { @@ -559,8 +559,8 @@ void BroadcastChannel::PostMessageData(BroadcastChannelMessage* aData) { if (mActor) { - nsRefPtr runnable = - new PostMessageRunnable(mActor, aData); + nsRefPtr runnable = + new BCPostMessageRunnable(mActor, aData); if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) { NS_WARNING("Failed to dispatch to the current thread!"); diff --git a/dom/broadcastchannel/moz.build b/dom/broadcastchannel/moz.build index 01c795f8743..6ff7e04872c 100644 --- a/dom/broadcastchannel/moz.build +++ b/dom/broadcastchannel/moz.build @@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [ 'BroadcastChannel.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'BroadcastChannel.cpp', 'BroadcastChannelChild.cpp', 'BroadcastChannelParent.cpp', diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp index b76093ddc16..876e99b201e 100644 --- a/dom/events/MessageEvent.cpp +++ b/dom/events/MessageEvent.cpp @@ -200,6 +200,12 @@ MessageEvent::SetPorts(MessagePortList* aPorts) mPorts = aPorts; } +void +MessageEvent::SetSource(mozilla::dom::MessagePort* aPort) +{ + mPortSource = aPort; +} + } // namespace dom } // namespace mozilla diff --git a/dom/events/MessageEvent.h b/dom/events/MessageEvent.h index 44262455c20..2dc8e35a5c0 100644 --- a/dom/events/MessageEvent.h +++ b/dom/events/MessageEvent.h @@ -58,10 +58,7 @@ public: void SetPorts(MessagePortList* aPorts); // Non WebIDL methods - void SetSource(mozilla::dom::MessagePort* aPort) - { - mPortSource = aPort; - } + void SetSource(mozilla::dom::MessagePort* aPort); void SetSource(nsPIDOMWindow* aWindow) {