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

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

Issue 2552343009: [Presentation API] Adds DOMString[] constructor to PresentationRequest. (Closed)
Patch Set: Created 4 years 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 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 : public EventTargetWithInlineData, 22 class MODULES_EXPORT PresentationRequest final
mark a. foltz 2016/12/09 05:38:03 Why is MODULES_EXPORT required? Is there somethin
whywhat 2016/12/09 22:44:09 It's needed for the unit tests (IIRC, in some buil
zhaobin 2016/12/09 23:02:00 Acknowledged.
21 public ActiveScriptWrappable, 23 : public EventTargetWithInlineData,
22 public ActiveDOMObject { 24 public ActiveScriptWrappable,
25 public ActiveDOMObject {
23 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); 26 USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest);
24 DEFINE_WRAPPERTYPEINFO(); 27 DEFINE_WRAPPERTYPEINFO();
25 28
26 public: 29 public:
27 ~PresentationRequest() = default; 30 ~PresentationRequest() = default;
28 31
29 static PresentationRequest* create(ExecutionContext*, 32 static PresentationRequest* create(ExecutionContext*,
30 const String& url, 33 const String& url,
31 ExceptionState&); 34 ExceptionState&);
35 static PresentationRequest* create(ExecutionContext*,
36 const WTF::Vector<String>& urls,
37 ExceptionState&);
32 38
33 // EventTarget implementation. 39 // EventTarget implementation.
34 const AtomicString& interfaceName() const override; 40 const AtomicString& interfaceName() const override;
35 ExecutionContext* getExecutionContext() const override; 41 ExecutionContext* getExecutionContext() const override;
36 42
37 // ScriptWrappable implementation. 43 // ScriptWrappable implementation.
38 bool hasPendingActivity() const final; 44 bool hasPendingActivity() const final;
39 45
40 ScriptPromise start(ScriptState*); 46 ScriptPromise start(ScriptState*);
41 ScriptPromise reconnect(ScriptState*, const String& id); 47 ScriptPromise reconnect(ScriptState*, const String& id);
42 ScriptPromise getAvailability(ScriptState*); 48 ScriptPromise getAvailability(ScriptState*);
43 49
44 const KURL& url() const; 50 const WTF::Vector<KURL>& urls() const;
45 51
46 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); 52 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable);
47 53
48 DECLARE_VIRTUAL_TRACE(); 54 DECLARE_VIRTUAL_TRACE();
49 55
50 protected: 56 protected:
51 // EventTarget implementation. 57 // EventTarget implementation.
52 void addedEventListener(const AtomicString& eventType, 58 void addedEventListener(const AtomicString& eventType,
53 RegisteredEventListener&) override; 59 RegisteredEventListener&) override;
54 60
55 private: 61 private:
56 PresentationRequest(ExecutionContext*, const KURL&); 62 PresentationRequest(ExecutionContext*, const WTF::Vector<KURL>&);
57 63
58 KURL m_url; 64 WTF::Vector<KURL> m_urls;
59 }; 65 };
60 66
61 } // namespace blink 67 } // namespace blink
62 68
63 #endif // PresentationRequest_h 69 #endif // PresentationRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698