| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ServiceWorkerMessageEvent_h | 5 #ifndef ServiceWorkerMessageEvent_h |
| 6 #define ServiceWorkerMessageEvent_h | 6 #define ServiceWorkerMessageEvent_h |
| 7 | 7 |
| 8 #include "core/dom/DOMArrayBuffer.h" | 8 #include "core/dom/DOMArrayBuffer.h" |
| 9 #include "core/dom/MessagePort.h" | 9 #include "core/dom/MessagePort.h" |
| 10 #include "modules/EventModules.h" | 10 #include "modules/EventModules.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/serviceworkers/ServiceWorkerMessageEventInit.h" | 12 #include "modules/serviceworkers/ServiceWorkerMessageEventInit.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class MODULES_EXPORT ServiceWorkerMessageEvent final : public Event { | 16 class MODULES_EXPORT ServiceWorkerMessageEvent final : public Event { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 18 public: |
| 19 static RawPtr<ServiceWorkerMessageEvent> create() | 19 static ServiceWorkerMessageEvent* create() |
| 20 { | 20 { |
| 21 return new ServiceWorkerMessageEvent; | 21 return new ServiceWorkerMessageEvent; |
| 22 } | 22 } |
| 23 | 23 |
| 24 static RawPtr<ServiceWorkerMessageEvent> create(const AtomicString& type, co
nst ServiceWorkerMessageEventInit& initializer) | 24 static ServiceWorkerMessageEvent* create(const AtomicString& type, const Ser
viceWorkerMessageEventInit& initializer) |
| 25 { | 25 { |
| 26 return new ServiceWorkerMessageEvent(type, initializer); | 26 return new ServiceWorkerMessageEvent(type, initializer); |
| 27 } | 27 } |
| 28 | 28 |
| 29 static RawPtr<ServiceWorkerMessageEvent> create(MessagePortArray* ports, Pas
sRefPtr<SerializedScriptValue> data, ServiceWorker* source, const String& origin
) | 29 static ServiceWorkerMessageEvent* create(MessagePortArray* ports, PassRefPtr
<SerializedScriptValue> data, ServiceWorker* source, const String& origin) |
| 30 { | 30 { |
| 31 return new ServiceWorkerMessageEvent(data, origin, String(), source, por
ts); | 31 return new ServiceWorkerMessageEvent(data, origin, String(), source, por
ts); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ~ServiceWorkerMessageEvent() override; | 34 ~ServiceWorkerMessageEvent() override; |
| 35 | 35 |
| 36 SerializedScriptValue* serializedData() const { return m_serializedData.get(
); } | 36 SerializedScriptValue* serializedData() const { return m_serializedData.get(
); } |
| 37 void setSerializedData(PassRefPtr<SerializedScriptValue> serializedData) { m
_serializedData = serializedData; } | 37 void setSerializedData(PassRefPtr<SerializedScriptValue> serializedData) { m
_serializedData = serializedData; } |
| 38 const String& origin() const { return m_origin; } | 38 const String& origin() const { return m_origin; } |
| 39 const String& lastEventId() const { return m_lastEventId; } | 39 const String& lastEventId() const { return m_lastEventId; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 String m_origin; | 54 String m_origin; |
| 55 String m_lastEventId; | 55 String m_lastEventId; |
| 56 Member<ServiceWorker> m_sourceAsServiceWorker; | 56 Member<ServiceWorker> m_sourceAsServiceWorker; |
| 57 Member<MessagePort> m_sourceAsMessagePort; | 57 Member<MessagePort> m_sourceAsMessagePort; |
| 58 Member<MessagePortArray> m_ports; | 58 Member<MessagePortArray> m_ports; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace blink | 61 } // namespace blink |
| 62 | 62 |
| 63 #endif // ServiceWorkerMessageEvent_h | 63 #endif // ServiceWorkerMessageEvent_h |
| OLD | NEW |