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

Side by Side Diff: Source/modules/presentation/PresentationSession.h

Issue 940503002: [PresentationAPI] Added plumbing for start/joinSession from JS to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comment Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 PresentationSession_h 5 #ifndef PresentationSession_h
6 #define PresentationSession_h 6 #define PresentationSession_h
7 7
8 #include "core/dom/ContextLifecycleObserver.h"
9 #include "core/events/EventTarget.h" 8 #include "core/events/EventTarget.h"
9 #include "core/frame/DOMWindowProperty.h"
10 #include "wtf/text/AtomicString.h" 10 #include "wtf/text/AtomicString.h"
11 #include "wtf/text/WTFString.h" 11 #include "wtf/text/WTFString.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class WebPresentationSessionClient;
16
15 class PresentationSession final 17 class PresentationSession final
16 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes sion> 18 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes sion>
17 , public ContextLifecycleObserver { 19 , public DOMWindowProperty {
18 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P resentationSession>); 20 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P resentationSession>);
19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession);
20 DEFINE_WRAPPERTYPEINFO(); 22 DEFINE_WRAPPERTYPEINFO();
21 public: 23 public:
22 static PresentationSession* create(ExecutionContext*); 24 static PresentationSession* create(LocalFrame*, WebPresentationSessionClient *);
23 virtual ~PresentationSession(); 25 virtual ~PresentationSession();
24 26
25 // EventTarget implementation. 27 // EventTarget implementation.
26 virtual const AtomicString& interfaceName() const override; 28 virtual const AtomicString& interfaceName() const override;
27 virtual ExecutionContext* executionContext() const override; 29 virtual ExecutionContext* executionContext() const override;
28 30
29 DECLARE_VIRTUAL_TRACE(); 31 DECLARE_VIRTUAL_TRACE();
30 32
31 const String& id() const { return m_id; } 33 const String& id() const { return m_id; }
32 const AtomicString& state() const { return m_state; } 34 const AtomicString& state() const { return m_state; }
33 35
34 void postMessage(const String& message); 36 void postMessage(const String& message);
35 void close(); 37 void close();
36 38
37 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
38 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); 40 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
39 41
40 private: 42 private:
41 explicit PresentationSession(ExecutionContext*); 43 PresentationSession(LocalFrame*, WebPresentationSessionClient*);
42 44
43 String m_id; 45 String m_id;
44 AtomicString m_state; 46 AtomicString m_state;
45 }; 47 };
46 48
47 } // namespace blink 49 } // namespace blink
48 50
49 #endif // PresentationSession_h 51 #endif // PresentationSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698