Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationReceiver.h

Issue 2340433003: [Presentation API] 1-UA: notify receiver page when receiver connection becomes available (blink sid… (Closed)
Patch Set: resolve code review comments from dcheng Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 PresentationReceiver_h 5 #ifndef PresentationReceiver_h
6 #define PresentationReceiver_h 6 #define PresentationReceiver_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseProperty.h" 9 #include "bindings/core/v8/ScriptPromiseProperty.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/dom/DOMException.h" 11 #include "core/dom/DOMException.h"
12 #include "core/frame/DOMWindowProperty.h" 12 #include "core/frame/DOMWindowProperty.h"
13 #include "modules/ModulesExport.h" 13 #include "modules/ModulesExport.h"
14 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
15 #include "platform/heap/Heap.h" 15 #include "platform/heap/Heap.h"
16 #include "public/platform/modules/presentation/WebPresentationReceiver.h"
16 17
17 namespace blink { 18 namespace blink {
18 19
19 class PresentationConnection; 20 class PresentationConnection;
20 class PresentationConnectionList; 21 class PresentationConnectionList;
22 class WebPresentationClient;
21 class WebPresentationConnectionClient; 23 class WebPresentationConnectionClient;
22 24
23 // Implements the PresentationReceiver interface from the Presentation API from 25 // Implements the PresentationReceiver interface from the Presentation API from
24 // which websites can implement the receiving side of a presentation session. 26 // which websites can implement the receiving side of a presentation session.
25 class MODULES_EXPORT PresentationReceiver final 27 class MODULES_EXPORT PresentationReceiver final
26 : public GarbageCollected<PresentationReceiver> 28 : public GarbageCollectedFinalized<PresentationReceiver>
27 , public ScriptWrappable 29 , public ScriptWrappable
28 , public DOMWindowProperty { 30 , public DOMWindowProperty
31 , public WebPresentationReceiver {
29 USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver); 32 USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver);
30 DEFINE_WRAPPERTYPEINFO(); 33 DEFINE_WRAPPERTYPEINFO();
31 34 using ConnectionListProperty = ScriptPromiseProperty<Member<PresentationRece iver>, Member<PresentationConnectionList>,
32 using ConnectionListProperty = ScriptPromiseProperty<Member<PresentationRece iver>, Member<PresentationConnectionList>, Member<DOMException>>; 35 Member<DOMException>>;
33 36
34 public: 37 public:
35 explicit PresentationReceiver(LocalFrame*); 38 explicit PresentationReceiver(LocalFrame*, WebPresentationClient*);
36 ~PresentationReceiver() = default; 39 ~PresentationReceiver() = default;
37 40
38 // PresentationReceiver.idl implementation 41 // PresentationReceiver.idl implementation
39 ScriptPromise connectionList(ScriptState*); 42 ScriptPromise connectionList(ScriptState*);
40 43
41 void onConnectionReceived(WebPresentationConnectionClient*); 44 // Implementation of WebPresentationController.
45 void onReceiverConnectionAvailable(WebPresentationConnectionClient*) overrid e;
42 void registerConnection(PresentationConnection*); 46 void registerConnection(PresentationConnection*);
43 47
44 DECLARE_VIRTUAL_TRACE(); 48 DECLARE_VIRTUAL_TRACE();
45 49
46 private: 50 private:
47 friend class PresentationReceiverTest; 51 friend class PresentationReceiverTest;
48 52
49 Member<ConnectionListProperty> m_connectionListProperty; 53 Member<ConnectionListProperty> m_connectionListProperty;
50 Member<PresentationConnectionList> m_connectionList; 54 Member<PresentationConnectionList> m_connectionList;
51 }; 55 };
52 56
53 } // namespace blink 57 } // namespace blink
54 58
55 #endif // PresentationReceiver_h 59 #endif // PresentationReceiver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698