Commit 65e4261b authored by ojan@chromium.org's avatar ojan@chromium.org

Revert "Push API: define push event on Service Worker."

This reverts r175672. It breaks the browser_tests compile
on Linux (and probably everywhere).

../../third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp:103:74: error: no member named 'push' in namespace 'WebCore::EventTypeNames'
    m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, data));

TBR=mvanouwerkerk@chromium.org

Review URL: https://codereview.chromium.org/314373002

git-svn-id: svn://svn.chromium.org/blink/trunk@175677 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5d9090f2
...@@ -259,7 +259,6 @@ PopStateEvent ...@@ -259,7 +259,6 @@ PopStateEvent
ProcessingInstruction ProcessingInstruction
ProgressEvent ProgressEvent
Promise Promise
PushEvent
RGBColor RGBColor
RTCIceCandidate RTCIceCandidate
RTCSessionDescription RTCSessionDescription
......
...@@ -145,7 +145,6 @@ pointerlockchange ...@@ -145,7 +145,6 @@ pointerlockchange
pointerlockerror pointerlockerror
popstate popstate
progress progress
push
ratechange ratechange
ready ready
readystatechange readystatechange
......
...@@ -110,7 +110,6 @@ ...@@ -110,7 +110,6 @@
'notifications/Notification.idl', 'notifications/Notification.idl',
'notifications/NotificationPermissionCallback.idl', 'notifications/NotificationPermissionCallback.idl',
'performance/WorkerPerformance.idl', 'performance/WorkerPerformance.idl',
'push_messaging/PushEvent.idl',
'push_messaging/PushManager.idl', 'push_messaging/PushManager.idl',
'push_messaging/PushRegistration.idl', 'push_messaging/PushRegistration.idl',
'quota/DeprecatedStorageInfo.idl', 'quota/DeprecatedStorageInfo.idl',
...@@ -229,7 +228,6 @@ ...@@ -229,7 +228,6 @@
'performance/SharedWorkerPerformance.idl', 'performance/SharedWorkerPerformance.idl',
'performance/WorkerGlobalScopePerformance.idl', 'performance/WorkerGlobalScopePerformance.idl',
'push_messaging/NavigatorPushManager.idl', 'push_messaging/NavigatorPushManager.idl',
'push_messaging/ServiceWorkerGlobalScopePush.idl',
'quota/NavigatorStorageQuota.idl', 'quota/NavigatorStorageQuota.idl',
'quota/WindowQuota.idl', 'quota/WindowQuota.idl',
'quota/WorkerNavigatorStorageQuota.idl', 'quota/WorkerNavigatorStorageQuota.idl',
...@@ -257,7 +255,6 @@ ...@@ -257,7 +255,6 @@
'mediastream/RTCDTMFToneChangeEvent.idl', 'mediastream/RTCDTMFToneChangeEvent.idl',
'mediastream/RTCDataChannelEvent.idl', 'mediastream/RTCDataChannelEvent.idl',
'mediastream/RTCIceCandidateEvent.idl', 'mediastream/RTCIceCandidateEvent.idl',
'push_messaging/PushEvent.idl',
'serviceworkers/FetchEvent.idl', 'serviceworkers/FetchEvent.idl',
'serviceworkers/InstallEvent.idl', 'serviceworkers/InstallEvent.idl',
'serviceworkers/InstallPhaseEvent.idl', 'serviceworkers/InstallPhaseEvent.idl',
...@@ -612,13 +609,10 @@ ...@@ -612,13 +609,10 @@
'push_messaging/PushController.h', 'push_messaging/PushController.h',
'push_messaging/PushError.cpp', 'push_messaging/PushError.cpp',
'push_messaging/PushError.h', 'push_messaging/PushError.h',
'push_messaging/PushEvent.cpp',
'push_messaging/PushEvent.h',
'push_messaging/PushManager.cpp', 'push_messaging/PushManager.cpp',
'push_messaging/PushManager.h', 'push_messaging/PushManager.h',
'push_messaging/PushRegistration.cpp', 'push_messaging/PushRegistration.cpp',
'push_messaging/PushRegistration.h', 'push_messaging/PushRegistration.h',
'push_messaging/ServiceWorkerGlobalScopePush.h',
'quota/DOMWindowQuota.cpp', 'quota/DOMWindowQuota.cpp',
'quota/DOMWindowQuota.h', 'quota/DOMWindowQuota.h',
'quota/DeprecatedStorageInfo.cpp', 'quota/DeprecatedStorageInfo.cpp',
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "modules/push_messaging/PushEvent.h"
namespace WebCore {
PushEventInit::PushEventInit()
{
}
PushEvent::PushEvent()
{
ScriptWrappable::init(this);
}
PushEvent::PushEvent(const AtomicString& type, const String& data)
: Event(type, /*canBubble=*/false, /*cancelable=*/false)
, m_data(data)
{
ScriptWrappable::init(this);
}
PushEvent::PushEvent(const AtomicString& type, const PushEventInit& initializer)
: Event(type, initializer)
, m_data(initializer.data)
{
ScriptWrappable::init(this);
}
PushEvent::~PushEvent()
{
}
const AtomicString& PushEvent::interfaceName() const
{
return EventNames::PushEvent;
}
} // namespace WebCore
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PushEvent_h
#define PushEvent_h
#include "modules/EventModules.h"
#include "platform/heap/Handle.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
struct PushEventInit : public EventInit {
PushEventInit();
String data;
};
class PushEvent FINAL : public Event {
public:
static PassRefPtrWillBeRawPtr<PushEvent> create()
{
return adoptRefWillBeNoop(new PushEvent);
}
static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, const String& data)
{
return adoptRefWillBeNoop(new PushEvent(type, data));
}
static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, const PushEventInit& initializer)
{
return adoptRefWillBeNoop(new PushEvent(type, initializer));
}
virtual ~PushEvent();
virtual const AtomicString& interfaceName() const OVERRIDE;
String data() const { return m_data; }
private:
PushEvent();
PushEvent(const AtomicString& type, const String& data);
PushEvent(const AtomicString& type, const PushEventInit&);
String m_data;
};
} // namespace WebCore
#endif // PushEvent_h
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
EventConstructor,
RuntimeEnabled=PushMessaging,
] interface PushEvent : Event {
[InitializedByEventConstructor] readonly attribute DOMString data;
};
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ServiceWorkerGlobalScopePush_h
#define ServiceWorkerGlobalScopePush_h
#include "core/events/EventTarget.h"
namespace WebCore {
class ServiceWorkerGlobalScopePush {
public:
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(push);
};
} // namespace WebCore
#endif // ServiceWorkerGlobalScopePush_h
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
RuntimeEnabled=PushMessaging,
] partial interface ServiceWorkerGlobalScope {
attribute EventHandler onpush;
};
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "core/dom/MessagePort.h" #include "core/dom/MessagePort.h"
#include "core/events/MessageEvent.h" #include "core/events/MessageEvent.h"
#include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerGlobalScope.h"
#include "modules/push_messaging/PushEvent.h"
#include "modules/serviceworkers/FetchEvent.h" #include "modules/serviceworkers/FetchEvent.h"
#include "modules/serviceworkers/InstallEvent.h" #include "modules/serviceworkers/InstallEvent.h"
#include "modules/serviceworkers/InstallPhaseEvent.h" #include "modules/serviceworkers/InstallPhaseEvent.h"
...@@ -97,12 +96,6 @@ void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag ...@@ -97,12 +96,6 @@ void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), value)); m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), value));
} }
void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebString& data)
{
ASSERT(m_workerGlobalScope);
m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, data));
}
void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
{ {
ASSERT(m_workerGlobalScope); ASSERT(m_workerGlobalScope);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define ServiceWorkerGlobalScopeProxy_h #define ServiceWorkerGlobalScopeProxy_h
#include "core/workers/WorkerReportingProxy.h" #include "core/workers/WorkerReportingProxy.h"
#include "public/platform/WebString.h"
#include "public/web/WebServiceWorkerContextProxy.h" #include "public/web/WebServiceWorkerContextProxy.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/OwnPtr.h" #include "wtf/OwnPtr.h"
...@@ -72,7 +71,6 @@ public: ...@@ -72,7 +71,6 @@ public:
virtual void dispatchInstallEvent(int) OVERRIDE; virtual void dispatchInstallEvent(int) OVERRIDE;
virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRIDE; virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRIDE;
virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) OVERRIDE; virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) OVERRIDE;
virtual void dispatchPushEvent(int, const WebString& data) OVERRIDE;
virtual void dispatchSyncEvent(int) OVERRIDE; virtual void dispatchSyncEvent(int) OVERRIDE;
// WorkerReportingProxy overrides: // WorkerReportingProxy overrides:
......
...@@ -51,8 +51,6 @@ public: ...@@ -51,8 +51,6 @@ public:
virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& channels) = 0; virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& channels) = 0;
virtual void dispatchPushEvent(int eventID, const WebString& data) = 0;
// Once the ServiceWorker has finished handling the sync event // Once the ServiceWorker has finished handling the sync event
// didHandleSyncEvent is called on the context client. // didHandleSyncEvent is called on the context client.
virtual void dispatchSyncEvent(int syncEventID) = 0; virtual void dispatchSyncEvent(int syncEventID) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment