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 PresentationRequest_h | 5 #ifndef PresentationRequest_h |
6 #define PresentationRequest_h | 6 #define PresentationRequest_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
11 #include "core/events/EventTarget.h" | 11 #include "core/events/EventTarget.h" |
| 12 #include "modules/ModulesExport.h" |
12 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
13 #include "platform/heap/Heap.h" | 14 #include "platform/heap/Heap.h" |
14 #include "platform/weborigin/KURL.h" | 15 #include "platform/weborigin/KURL.h" |
| 16 #include "wtf/Vector.h" |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 | 19 |
18 // Implements the PresentationRequest interface from the Presentation API from | 20 // Implements the PresentationRequest interface from the Presentation API from |
19 // which websites can start or join presentation connections. | 21 // which websites can start or join presentation connections. |
20 class PresentationRequest final | 22 class MODULES_EXPORT PresentationRequest final |
21 : public EventTargetWithInlineData | 23 : public EventTargetWithInlineData |
22 , public ActiveScriptWrappable | 24 , public ActiveScriptWrappable |
23 , public ActiveDOMObject { | 25 , public ActiveDOMObject { |
24 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); | 26 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); |
25 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
26 public: | 28 public: |
27 ~PresentationRequest() = default; | 29 ~PresentationRequest() = default; |
28 | 30 |
29 static PresentationRequest* create(ExecutionContext*, const String& url, Exc
eptionState&); | 31 static PresentationRequest* create(ExecutionContext*, const String& url, Exc
eptionState&); |
| 32 static PresentationRequest* create(ExecutionContext*, const WTF::Vector<Stri
ng>& urls, ExceptionState&); |
30 | 33 |
31 // EventTarget implementation. | 34 // EventTarget implementation. |
32 const AtomicString& interfaceName() const override; | 35 const AtomicString& interfaceName() const override; |
33 ExecutionContext* getExecutionContext() const override; | 36 ExecutionContext* getExecutionContext() const override; |
34 | 37 |
35 // ActiveScriptWrappable implementation. | 38 // ActiveScriptWrappable implementation. |
36 bool hasPendingActivity() const final; | 39 bool hasPendingActivity() const final; |
37 | 40 |
38 ScriptPromise start(ScriptState*); | 41 ScriptPromise start(ScriptState*); |
39 ScriptPromise reconnect(ScriptState*, const String& id); | 42 ScriptPromise reconnect(ScriptState*, const String& id); |
40 ScriptPromise getAvailability(ScriptState*); | 43 ScriptPromise getAvailability(ScriptState*); |
41 | 44 |
42 const KURL& url() const; | 45 const WTF::Vector<KURL>& urls() const; |
43 | 46 |
44 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); | 47 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); |
45 | 48 |
46 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
47 | 50 |
48 protected: | 51 protected: |
49 // EventTarget implementation. | 52 // EventTarget implementation. |
50 void addedEventListener(const AtomicString& eventType, RegisteredEventListen
er&) override; | 53 void addedEventListener(const AtomicString& eventType, RegisteredEventListen
er&) override; |
51 | 54 |
52 private: | 55 private: |
53 PresentationRequest(ExecutionContext*, const KURL&); | 56 PresentationRequest(ExecutionContext*, const WTF::Vector<KURL>&); |
54 | 57 |
55 KURL m_url; | 58 WTF::Vector<KURL> m_urls; |
56 }; | 59 }; |
57 | 60 |
58 } // namespace blink | 61 } // namespace blink |
59 | 62 |
60 #endif // PresentationRequest_h | 63 #endif // PresentationRequest_h |
OLD | NEW |