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.
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "core/dom/ContextLifecycleObserver.h"
10 #include "core/events/EventTarget.h"
11 #include "modules/presentation/PresentationSession.h"
17 class Presentation final
18 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentation>
19 , public EventTargetWithInlineData
20 , public ContextLifecycleObserver {
21 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<Presentation>);
22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation);
23 DEFINE_WRAPPERTYPEINFO();
25 static Presentation* create(ExecutionContext*);
26 virtual ~Presentation();
28 // EventTarget implementation.
29 virtual const AtomicString& interfaceName() const override;
30 virtual ExecutionContext* executionContext() const override;
32 virtual void trace(Visitor*) override;
34 PresentationSession* session() const;
36 ScriptPromise startSession(ScriptState*, const String& senderId, const String& presentationId);
37 ScriptPromise joinSession(ScriptState*, const String& senderId, const String& presentationId);
39 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange);
42 explicit Presentation(ExecutionContext*);
44 Member<PresentationSession> m_session;
49 #endif // Presentation_h