Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: Source/modules/presentation/Presentation.cpp

Issue 685263003: The rest of the Presentation API IDL as stubs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed nits Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
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 {
39 EventTargetWithInlineData::trace(visitor); 43 EventTargetWithInlineData::trace(visitor);
44 visitor->trace(m_session);
45 }
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;
40 } 66 }
41 67
42 } // namespace blink 68 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698