OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ExtendableMessageEvent_h | 5 #ifndef ExtendableMessageEvent_h |
6 #define ExtendableMessageEvent_h | 6 #define ExtendableMessageEvent_h |
7 | 7 |
8 #include "modules/EventModules.h" | 8 #include "modules/EventModules.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "modules/serviceworkers/ExtendableEvent.h" | 10 #include "modules/serviceworkers/ExtendableEvent.h" |
11 #include "modules/serviceworkers/ExtendableMessageEventInit.h" | 11 #include "modules/serviceworkers/ExtendableMessageEventInit.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class MODULES_EXPORT ExtendableMessageEvent final : public ExtendableEvent { | 15 class MODULES_EXPORT ExtendableMessageEvent final : public ExtendableEvent { |
16 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
17 | 17 |
18 public: | 18 public: |
19 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(); | 19 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(); |
20 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicStr ing& type, const ExtendableMessageEventInit& initializer); | 20 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicStr ing& type, const ExtendableMessageEventInit& initializer); |
21 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicStr ing& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver*); | 21 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicStr ing& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver*); |
22 static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(PassRefPtr<Seri alizedScriptValue> data, const String& origin, PassOwnPtrWillBeRawPtr<MessagePor tArray> ports, WaitUntilObserver*); | |
23 | |
24 ScriptValue data() const { return m_data; } | |
25 SerializedScriptValue* serializedData() const { return m_serializedData.get( ); } | |
26 const String& origin() const { return m_origin; } | |
27 const String& lastEventId() const { return m_lastEventId; } | |
28 MessagePortArray ports(bool& isNull) const; | |
29 MessagePortArray ports() const; | |
30 void source(ClientOrServiceWorkerOrMessagePort& result) const; | |
22 | 31 |
23 const AtomicString& interfaceName() const override; | 32 const AtomicString& interfaceName() const override; |
24 | 33 |
25 DECLARE_VIRTUAL_TRACE(); | 34 DECLARE_VIRTUAL_TRACE(); |
26 | 35 |
27 private: | 36 private: |
28 ExtendableMessageEvent(); | 37 ExtendableMessageEvent(); |
29 ExtendableMessageEvent(const AtomicString& type, const ExtendableMessageEven tInit& initializer); | 38 ExtendableMessageEvent(const AtomicString& type, const ExtendableMessageEven tInit& initializer); |
30 ExtendableMessageEvent(const AtomicString& type, const ExtendableMessageEven tInit& initializer, WaitUntilObserver*); | 39 ExtendableMessageEvent(const AtomicString& type, const ExtendableMessageEven tInit& initializer, WaitUntilObserver*); |
40 ExtendableMessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, PassOwnPtrWillBeRawPtr<MessagePortArray> ports, WaitUntilObserver*); | |
41 | |
42 ScriptValue m_data; | |
bashi
2016/02/10 00:38:55
We cannot hold a ScriptValue in a DOM impl class.
nhiroki
2016/02/10 08:08:57
Done.
| |
43 RefPtr<SerializedScriptValue> m_serializedData; | |
44 String m_origin; | |
45 String m_lastEventId; | |
46 Member<ServiceWorkerClient> m_sourceAsClient; | |
47 Member<ServiceWorker> m_sourceAsServiceWorker; | |
48 Member<MessagePort> m_sourceAsMessagePort; | |
49 OwnPtrWillBeMember<MessagePortArray> m_ports; | |
31 }; | 50 }; |
32 | 51 |
33 } // namespace blink | 52 } // namespace blink |
34 | 53 |
35 #endif // ExtendableMessageEvent_h | 54 #endif // ExtendableMessageEvent_h |
OLD | NEW |