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 #include "config.h" | 5 #include "config.h" |
6 #include "modules/presentation/Presentation.h" | 6 #include "modules/presentation/Presentation.h" |
7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "bindings/core/v8/ScriptState.h" |
| 11 #include "core/dom/DOMException.h" |
8 #include "modules/EventTargetModules.h" | 12 #include "modules/EventTargetModules.h" |
9 | 13 |
10 namespace blink { | 14 namespace blink { |
11 | 15 |
12 Presentation::Presentation(ExecutionContext* executionContext) | 16 Presentation::Presentation(ExecutionContext* executionContext) |
13 : ContextLifecycleObserver(executionContext) | 17 : ContextLifecycleObserver(executionContext) |
14 { | 18 { |
15 } | 19 } |
16 | 20 |
17 Presentation::~Presentation() | 21 Presentation::~Presentation() |
(...skipping 11 matching lines...) Expand all Loading... |
29 return EventTargetNames::Presentation; | 33 return EventTargetNames::Presentation; |
30 } | 34 } |
31 | 35 |
32 ExecutionContext* Presentation::executionContext() const | 36 ExecutionContext* Presentation::executionContext() const |
33 { | 37 { |
34 return ContextLifecycleObserver::executionContext(); | 38 return ContextLifecycleObserver::executionContext(); |
35 } | 39 } |
36 | 40 |
37 void Presentation::trace(Visitor* visitor) | 41 void Presentation::trace(Visitor* visitor) |
38 { | 42 { |
| 43 visitor->trace(m_session); |
39 EventTargetWithInlineData::trace(visitor); | 44 EventTargetWithInlineData::trace(visitor); |
40 } | 45 } |
41 | 46 |
| 47 PresentationSession* Presentation::session() const |
| 48 { |
| 49 return m_session.get(); |
| 50 } |
| 51 |
| 52 ScriptPromise Presentation::startSession(ScriptState* state, const String& sende
rId, const String& presentationId) |
| 53 { |
| 54 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state
); |
| 55 ScriptPromise promise = resolver->promise(); |
| 56 resolver->reject(DOMException::create(NotSupportedError, "The method is not
supported yet.")); |
| 57 return promise; |
| 58 } |
| 59 |
| 60 ScriptPromise Presentation::joinSession(ScriptState* state, const String& sender
Id, const String& presentationId) |
| 61 { |
| 62 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state
); |
| 63 ScriptPromise promise = resolver->promise(); |
| 64 resolver->reject(DOMException::create(NotSupportedError, "The method is not
supported yet.")); |
| 65 return promise; |
| 66 } |
| 67 |
42 } // namespace blink | 68 } // namespace blink |
OLD | NEW |