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

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

Issue 285403002: Push API: define push event on Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Define PushEvent with data attribute. Created 6 years, 7 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
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..f901e587558b99fc22ca8547be52c587729af63c
--- /dev/null
+++ b/Source/modules/push_messaging/PushEvent.h
@@ -0,0 +1,48 @@
+// 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 "core/events/Event.h"
+
Peter Beverloo 2014/05/16 15:41:43 IWYU please
Michael van Ouwerkerk 2014/05/21 17:06:42 Done.
+namespace WebCore {
+
+struct PushEventInit : public EventInit {
+ PushEventInit();
+
+ String data;
+};
+
+class PushEvent FINAL : public Event {
+public:
+ static PassRefPtr<PushEvent> create()
Peter Beverloo 2014/05/16 15:41:43 PassRefPtrWillBeRawPtr (elsewhere too)
Michael van Ouwerkerk 2014/05/21 17:06:42 Done.
+ {
+ return adoptRef(new PushEvent);
Peter Beverloo 2014/05/16 15:41:43 adoptRefWillBeNoop (elsewhere too)
Michael van Ouwerkerk 2014/05/21 17:06:42 Done.
+ }
+ static PassRefPtr<PushEvent> create(const AtomicString& type, const String& data)
+ {
+ return adoptRef(new PushEvent(type, data));
+ }
+ static PassRefPtr<PushEvent> create(const AtomicString& type, const PushEventInit& initializer)
+ {
+ return adoptRef(new PushEvent(type, initializer));
+ }
+
+ virtual ~PushEvent();
+
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+
+ String data() const { return m_data; }
+
Peter Beverloo 2014/05/16 15:41:43 Hmm. Most other Event implementations override the
Michael van Ouwerkerk 2014/05/21 17:06:42 Ok.
+private:
+ PushEvent();
+ PushEvent(const AtomicString& type, const String& data);
+ PushEvent(const AtomicString&, const PushEventInit&);
Peter Beverloo 2014/05/16 15:41:43 Please name the first argument (since AtomicString
Michael van Ouwerkerk 2014/05/21 17:06:42 Done.
+ String m_data;
+};
+
+} // namespace WebCore
+
+#endif // PushEvent_h

Powered by Google App Engine
This is Rietveld 408576698