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

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

Issue 2265363002: [Presentation API] make PresentationReceiver API consistent with latest spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix layout test global-interface-listing.html Created 4 years, 3 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 "core/events/EventTarget.h" 9 #include "bindings/core/v8/ScriptPromiseProperty.h"
10 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "core/frame/DOMWindowProperty.h" 11 #include "core/frame/DOMWindowProperty.h"
11 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
12 #include "platform/heap/Heap.h" 13 #include "platform/heap/Heap.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
17 class PresentationConnectionList;
18 class PresentationReceiver;
19
20 using ConnectionListProperty = ScriptPromiseProperty<Member<PresentationReceiver >, Member<PresentationConnectionList>, Member<DOMException>>;
21
16 // Implements the PresentationReceiver interface from the Presentation API from 22 // Implements the PresentationReceiver interface from the Presentation API from
17 // which websites can implement the receiving side of a presentation session. 23 // which websites can implement the receiving side of a presentation session.
18 class PresentationReceiver final 24 class PresentationReceiver final
19 : public EventTargetWithInlineData 25 : public GarbageCollected<PresentationReceiver>
20 , DOMWindowProperty { 26 , public ScriptWrappable
27 , public DOMWindowProperty {
21 USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver); 28 USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver);
22 DEFINE_WRAPPERTYPEINFO(); 29 DEFINE_WRAPPERTYPEINFO();
23 public: 30 public:
24 PresentationReceiver(LocalFrame*); 31 explicit PresentationReceiver(LocalFrame*);
25 ~PresentationReceiver() = default; 32 ~PresentationReceiver() = default;
26 33
27 // EventTarget implementation. 34 ScriptPromise connectionList(ScriptState*);
28 const AtomicString& interfaceName() const override;
29 ExecutionContext* getExecutionContext() const override;
30
31 ScriptPromise getConnection(ScriptState*);
32 ScriptPromise getConnections(ScriptState*);
33
34 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable);
35 35
36 DECLARE_VIRTUAL_TRACE(); 36 DECLARE_VIRTUAL_TRACE();
37
38 private:
39 Member<ConnectionListProperty> m_connectionListProperty;
37 }; 40 };
38 41
39 } // namespace blink 42 } // namespace blink
40 43
41 #endif // PresentationReceiver_h 44 #endif // PresentationReceiver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698