OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ServiceWorkerMessageEvent_h |
| 6 #define ServiceWorkerMessageEvent_h |
| 7 |
| 8 #include "core/dom/DOMArrayBuffer.h" |
| 9 #include "core/dom/MessagePort.h" |
| 10 #include "modules/EventModules.h" |
| 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/serviceworkers/ServiceWorkerMessageEventInit.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class MODULES_EXPORT ServiceWorkerMessageEvent final : public Event { |
| 17 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: |
| 19 static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create() |
| 20 { |
| 21 return adoptRefWillBeNoop(new ServiceWorkerMessageEvent); |
| 22 } |
| 23 |
| 24 static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create(const Atomic
String& type, const ServiceWorkerMessageEventInit& initializer) |
| 25 { |
| 26 return adoptRefWillBeNoop(new ServiceWorkerMessageEvent(type, initialize
r)); |
| 27 } |
| 28 |
| 29 static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create(PassOwnPtrWi
llBeRawPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, Pass
RefPtrWillBeRawPtr<ServiceWorker> source) |
| 30 { |
| 31 return adoptRefWillBeNoop(new ServiceWorkerMessageEvent(data, String(),
String(), source, ports)); |
| 32 } |
| 33 |
| 34 virtual ~ServiceWorkerMessageEvent(); |
| 35 |
| 36 ScriptValue data() const { return m_data; } |
| 37 SerializedScriptValue* serializedData() const { return m_serializedData.get(
); } |
| 38 const String& origin() const { return m_origin; } |
| 39 const String& lastEventId() const { return m_lastEventId; } |
| 40 MessagePortArray ports(bool& isNull) const; |
| 41 MessagePortArray ports() const; |
| 42 void source(ServiceWorkerOrMessagePort& result) const; |
| 43 |
| 44 virtual const AtomicString& interfaceName() const override; |
| 45 |
| 46 DECLARE_VIRTUAL_TRACE(); |
| 47 |
| 48 private: |
| 49 ServiceWorkerMessageEvent(); |
| 50 ServiceWorkerMessageEvent(const AtomicString& type, const ServiceWorkerMessa
geEventInit& initializer); |
| 51 ServiceWorkerMessageEvent(PassRefPtr<SerializedScriptValue> data, const Stri
ng& origin, const String& lastEventId, PassRefPtrWillBeRawPtr<ServiceWorker> sou
rce, PassOwnPtrWillBeRawPtr<MessagePortArray> ports); |
| 52 |
| 53 ScriptValue m_data; |
| 54 RefPtr<SerializedScriptValue> m_serializedData; |
| 55 String m_origin; |
| 56 String m_lastEventId; |
| 57 RefPtrWillBeMember<ServiceWorker> m_sourceAsServiceWorker; |
| 58 RefPtrWillBeMember<MessagePort> m_sourceAsMessagePort; |
| 59 OwnPtrWillBeMember<MessagePortArray> m_ports; |
| 60 }; |
| 61 |
| 62 } // namespace blink |
| 63 |
| 64 #endif // ServiceWorkerMessageEvent_h |
OLD | NEW |