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 "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "platform/heap/Heap.h" | 13 #include "platform/heap/Heap.h" |
14 #include "platform/weborigin/KURL.h" | 14 #include "platform/weborigin/KURL.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
| 18 class PresentationConnection; |
| 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 : public EventTargetWithInlineData, | 22 class PresentationRequest final : public EventTargetWithInlineData, |
21 public ActiveScriptWrappable, | 23 public ActiveScriptWrappable, |
22 public ActiveDOMObject { | 24 public ActiveDOMObject { |
23 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); | 25 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); |
24 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
25 | 27 |
26 public: | 28 public: |
27 ~PresentationRequest() = default; | 29 ~PresentationRequest() = default; |
(...skipping 10 matching lines...) Expand all Loading... |
38 bool hasPendingActivity() const final; | 40 bool hasPendingActivity() const final; |
39 | 41 |
40 ScriptPromise start(ScriptState*); | 42 ScriptPromise start(ScriptState*); |
41 ScriptPromise reconnect(ScriptState*, const String& id); | 43 ScriptPromise reconnect(ScriptState*, const String& id); |
42 ScriptPromise getAvailability(ScriptState*); | 44 ScriptPromise getAvailability(ScriptState*); |
43 | 45 |
44 const KURL& url() const; | 46 const KURL& url() const; |
45 | 47 |
46 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); | 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); |
47 | 49 |
| 50 void dispatchConnectionAvailableEvent(PresentationConnection*); |
| 51 |
48 DECLARE_VIRTUAL_TRACE(); | 52 DECLARE_VIRTUAL_TRACE(); |
49 | 53 |
50 protected: | 54 protected: |
51 // EventTarget implementation. | 55 // EventTarget implementation. |
52 void addedEventListener(const AtomicString& eventType, | 56 void addedEventListener(const AtomicString& eventType, |
53 RegisteredEventListener&) override; | 57 RegisteredEventListener&) override; |
54 | 58 |
55 private: | 59 private: |
56 PresentationRequest(ExecutionContext*, const KURL&); | 60 PresentationRequest(ExecutionContext*, const KURL&); |
57 | 61 |
58 KURL m_url; | 62 KURL m_url; |
59 }; | 63 }; |
60 | 64 |
61 } // namespace blink | 65 } // namespace blink |
62 | 66 |
63 #endif // PresentationRequest_h | 67 #endif // PresentationRequest_h |
OLD | NEW |