| OLD | NEW |
| 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 Presentation; |
| 16 class WebPresentationSessionClient; |
| 17 class WebString; |
| 18 |
| 15 class PresentationSession final | 19 class PresentationSession final |
| 16 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes
sion> | 20 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes
sion> |
| 17 , public ContextLifecycleObserver { | 21 , public DOMWindowProperty { |
| 18 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); | 22 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); | 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); |
| 20 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
| 21 public: | 25 public: |
| 22 static PresentationSession* create(ExecutionContext*); | 26 static PresentationSession* take(WebPresentationSessionClient*, Presentation
*); |
| 27 static void dispose(WebPresentationSessionClient*); |
| 23 virtual ~PresentationSession(); | 28 virtual ~PresentationSession(); |
| 24 | 29 |
| 25 // EventTarget implementation. | 30 // EventTarget implementation. |
| 26 virtual const AtomicString& interfaceName() const override; | 31 virtual const AtomicString& interfaceName() const override; |
| 27 virtual ExecutionContext* executionContext() const override; | 32 virtual ExecutionContext* executionContext() const override; |
| 28 | 33 |
| 29 DECLARE_VIRTUAL_TRACE(); | 34 DECLARE_VIRTUAL_TRACE(); |
| 30 | 35 |
| 31 const String& id() const { return m_id; } | 36 const String& id() const { return m_id; } |
| 32 const AtomicString& state() const { return m_state; } | 37 const AtomicString& state() const { return m_state; } |
| 33 | 38 |
| 34 void postMessage(const String& message); | 39 void postMessage(const String& message); |
| 35 void close(); | 40 void close(); |
| 36 | 41 |
| 37 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 38 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 43 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 39 | 44 |
| 40 private: | 45 private: |
| 41 explicit PresentationSession(ExecutionContext*); | 46 PresentationSession(LocalFrame*, const WebString& id); |
| 42 | 47 |
| 43 String m_id; | 48 String m_id; |
| 44 AtomicString m_state; | 49 AtomicString m_state; |
| 45 }; | 50 }; |
| 46 | 51 |
| 47 } // namespace blink | 52 } // namespace blink |
| 48 | 53 |
| 49 #endif // PresentationSession_h | 54 #endif // PresentationSession_h |
| OLD | NEW |