| 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 Presentation_h | 5 #ifndef Presentation_h |
| 6 #define Presentation_h | 6 #define Presentation_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 8 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 11 #include "modules/presentation/PresentationSession.h" |
| 10 | 12 |
| 11 namespace blink { | 13 namespace blink { |
| 12 | 14 |
| 15 class ScriptState; |
| 16 |
| 13 class Presentation final | 17 class Presentation final |
| 14 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentat
ion> | 18 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentat
ion> |
| 15 , public EventTargetWithInlineData | 19 , public EventTargetWithInlineData |
| 16 , public ContextLifecycleObserver { | 20 , public ContextLifecycleObserver { |
| 17 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentation>); | 21 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentation>); |
| 18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); |
| 19 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 20 public: | 24 public: |
| 21 static Presentation* create(ExecutionContext*); | 25 static Presentation* create(ExecutionContext*); |
| 22 virtual ~Presentation(); | 26 virtual ~Presentation(); |
| 23 | 27 |
| 24 // EventTarget implementation. | 28 // EventTarget implementation. |
| 25 virtual const AtomicString& interfaceName() const override; | 29 virtual const AtomicString& interfaceName() const override; |
| 26 virtual ExecutionContext* executionContext() const override; | 30 virtual ExecutionContext* executionContext() const override; |
| 27 | 31 |
| 28 virtual void trace(Visitor*) override; | 32 virtual void trace(Visitor*) override; |
| 29 | 33 |
| 34 PresentationSession* session() const; |
| 35 |
| 36 ScriptPromise startSession(ScriptState*, const String& senderId, const Strin
g& presentationId); |
| 37 ScriptPromise joinSession(ScriptState*, const String& senderId, const String
& presentationId); |
| 38 |
| 30 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); | 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); |
| 31 | 40 |
| 32 private: | 41 private: |
| 33 explicit Presentation(ExecutionContext*); | 42 explicit Presentation(ExecutionContext*); |
| 43 |
| 44 Member<PresentationSession> m_session; |
| 34 }; | 45 }; |
| 35 | 46 |
| 36 } // namespace blink | 47 } // namespace blink |
| 37 | 48 |
| 38 #endif // Presentation_h | 49 #endif // Presentation_h |
| OLD | NEW |