From 171ac8799b66de18839d8dc9121973054803b559 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 16 Mar 2016 13:44:24 -0700 Subject: [PATCH] Bug 1257042: Remove the worker descriptor for PushEvent and PushMessageData. r=bz --- dom/bindings/Bindings.conf | 2 -- dom/workers/ServiceWorkerEvents.cpp | 15 +++++++++++++++ dom/workers/ServiceWorkerEvents.h | 14 ++++---------- dom/workers/ServiceWorkerPrivate.cpp | 1 + 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 779f35d5ea70..c748c5faec10 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -935,13 +935,11 @@ DOMInterfaces = { 'PushEvent': { 'headerFile': 'ServiceWorkerEvents.h', 'nativeType': 'mozilla::dom::workers::PushEvent', - 'workers': True }, 'PushMessageData': { 'headerFile': 'ServiceWorkerEvents.h', 'nativeType': 'mozilla::dom::workers::PushMessageData', - 'workers': True }, 'PushManager': [{ diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index 2e5c0aecef68..0ca6c795212a 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -37,6 +37,9 @@ #include "mozilla/dom/workers/bindings/ServiceWorker.h" #ifndef MOZ_SIMPLEPUSH +#include "mozilla/dom/PushEventBinding.h" +#include "mozilla/dom/PushMessageDataBinding.h" + #include "nsIUnicodeDecoder.h" #include "nsIUnicodeEncoder.h" @@ -1022,6 +1025,12 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PushMessageData) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END +JSObject* +PushMessageData::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return mozilla::dom::PushMessageDataBinding::Wrap(aCx, this, aGivenProto); +} + void PushMessageData::Json(JSContext* cx, JS::MutableHandle aRetval, ErrorResult& aRv) @@ -1131,6 +1140,12 @@ NS_INTERFACE_MAP_END_INHERITING(ExtendableEvent) NS_IMPL_CYCLE_COLLECTION_INHERITED(PushEvent, ExtendableEvent, mData) +JSObject* +PushEvent::WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) +{ + return mozilla::dom::PushEventBinding::Wrap(aCx, this, aGivenProto); +} + #endif /* ! MOZ_SIMPLEPUSH */ ExtendableMessageEvent::ExtendableMessageEvent(EventTarget* aOwner) diff --git a/dom/workers/ServiceWorkerEvents.h b/dom/workers/ServiceWorkerEvents.h index 4b102203a782..5c8c5d41a104 100644 --- a/dom/workers/ServiceWorkerEvents.h +++ b/dom/workers/ServiceWorkerEvents.h @@ -16,8 +16,6 @@ #include "mozilla/dom/workers/bindings/ServiceWorker.h" #ifndef MOZ_SIMPLEPUSH -#include "mozilla/dom/PushEventBinding.h" -#include "mozilla/dom/PushMessageDataBinding.h" #include "mozilla/dom/File.h" #endif @@ -33,6 +31,8 @@ class MessagePort; class MessagePortList; class Request; class ResponseOrPromise; + +struct PushEventInit; } // namespace dom } // namespace mozilla @@ -188,10 +188,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushMessageData) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override - { - return mozilla::dom::PushMessageDataBinding_workers::Wrap(aCx, this, aGivenProto); - } + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { return mOwner; @@ -228,10 +225,7 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PushEvent, ExtendableEvent) NS_FORWARD_TO_EVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override - { - return mozilla::dom::PushEventBinding_workers::Wrap(aCx, this, aGivenProto); - } + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(mozilla::dom::EventTarget* aOwner, diff --git a/dom/workers/ServiceWorkerPrivate.cpp b/dom/workers/ServiceWorkerPrivate.cpp index d38d17644f2e..b7fc10262222 100644 --- a/dom/workers/ServiceWorkerPrivate.cpp +++ b/dom/workers/ServiceWorkerPrivate.cpp @@ -26,6 +26,7 @@ #include "mozilla/dom/InternalHeaders.h" #include "mozilla/dom/NotificationEvent.h" #include "mozilla/dom/PromiseNativeHandler.h" +#include "mozilla/dom/PushEventBinding.h" #include "mozilla/dom/RequestBinding.h" using namespace mozilla;