Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Unified Diff: Source/modules/push_messaging/PushEvent.h

Issue 318413002: Push API: define push event on Service Worker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/push_messaging/PushEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/push_messaging/PushEvent.h
diff --git a/Source/modules/push_messaging/PushEvent.h b/Source/modules/push_messaging/PushEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..07ddca10166dacfe38335c88b1bea93cd5c48c9c
--- /dev/null
+++ b/Source/modules/push_messaging/PushEvent.h
@@ -0,0 +1,51 @@
+// 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/push_messaging/PushEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698