| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PushEvent_h | 5 #ifndef PushEvent_h |
| 6 #define PushEvent_h | 6 #define PushEvent_h |
| 7 | 7 |
| 8 #include "modules/EventModules.h" | 8 #include "modules/EventModules.h" |
| 9 #include "modules/serviceworkers/ExtendableEvent.h" |
| 9 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 10 #include "wtf/text/AtomicString.h" | 11 #include "wtf/text/AtomicString.h" |
| 11 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 struct PushEventInit : public EventInit { | 16 struct PushEventInit : public ExtendableEventInit { |
| 16 PushEventInit(); | 17 PushEventInit(); |
| 17 | 18 |
| 18 String data; | 19 String data; |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 class PushEvent final : public Event { | 22 class PushEvent final : public ExtendableEvent { |
| 22 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 23 public: | 24 public: |
| 24 static PassRefPtrWillBeRawPtr<PushEvent> create() | 25 static PassRefPtrWillBeRawPtr<PushEvent> create() |
| 25 { | 26 { |
| 26 return adoptRefWillBeNoop(new PushEvent); | 27 return adoptRefWillBeNoop(new PushEvent); |
| 27 } | 28 } |
| 28 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, co
nst String& data) | 29 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, co
nst String& data, WaitUntilObserver* observer) |
| 29 { | 30 { |
| 30 return adoptRefWillBeNoop(new PushEvent(type, data)); | 31 return adoptRefWillBeNoop(new PushEvent(type, data, observer)); |
| 31 } | 32 } |
| 32 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, co
nst PushEventInit& initializer) | 33 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, co
nst PushEventInit& initializer) |
| 33 { | 34 { |
| 34 return adoptRefWillBeNoop(new PushEvent(type, initializer)); | 35 return adoptRefWillBeNoop(new PushEvent(type, initializer)); |
| 35 } | 36 } |
| 36 | 37 |
| 37 virtual ~PushEvent(); | 38 virtual ~PushEvent(); |
| 38 | 39 |
| 39 virtual const AtomicString& interfaceName() const override; | 40 virtual const AtomicString& interfaceName() const override; |
| 40 | 41 |
| 41 String data() const { return m_data; } | 42 String data() const { return m_data; } |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 PushEvent(); | 45 PushEvent(); |
| 45 PushEvent(const AtomicString& type, const String& data); | 46 PushEvent(const AtomicString& type, const String& data, WaitUntilObserver*); |
| 46 PushEvent(const AtomicString& type, const PushEventInit&); | 47 PushEvent(const AtomicString& type, const PushEventInit&); |
| 47 String m_data; | 48 String m_data; |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace blink | 51 } // namespace blink |
| 51 | 52 |
| 52 #endif // PushEvent_h | 53 #endif // PushEvent_h |
| OLD | NEW |