OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PresentationSession_h |
| 6 #define PresentationSession_h |
| 7 |
| 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/events/EventTarget.h" |
| 10 #include "wtf/text/AtomicString.h" |
| 11 #include "wtf/text/WTFString.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class PresentationSession final |
| 16 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentat
ionSession> |
| 17 , public EventTargetWithInlineData |
| 18 , public ContextLifecycleObserver { |
| 19 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); |
| 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); |
| 21 DEFINE_WRAPPERTYPEINFO(); |
| 22 public: |
| 23 static PresentationSession* create(ExecutionContext*); |
| 24 virtual ~PresentationSession(); |
| 25 |
| 26 // EventTarget implementation. |
| 27 virtual const AtomicString& interfaceName() const override; |
| 28 virtual ExecutionContext* executionContext() const override; |
| 29 |
| 30 virtual void trace(Visitor*) override; |
| 31 |
| 32 const String& id() const { return m_id; } |
| 33 const AtomicString& state() const { return m_state; } |
| 34 |
| 35 void postMessage(const String& message); |
| 36 void close(); |
| 37 |
| 38 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 40 |
| 41 private: |
| 42 explicit PresentationSession(ExecutionContext*); |
| 43 |
| 44 String m_id; |
| 45 AtomicString m_state; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // PresentationSession_h |
OLD | NEW |