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

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: 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"
Peter Beverloo 2014/10/29 20:51:19 You already include this in the header.
whywhat 2014/10/29 22:09:26 IWYU (include what you use)
9 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "modules/EventTargetModules.h" 10 #include "modules/EventTargetModules.h"
Peter Beverloo 2014/10/29 20:51:19 +#include "core/dom/DOMException.h"
whywhat 2014/10/29 22:09:26 Done.
9 11
10 namespace blink { 12 namespace blink {
11 13
12 Presentation::Presentation(ExecutionContext* executionContext) 14 Presentation::Presentation(ExecutionContext* executionContext)
13 : ContextLifecycleObserver(executionContext) 15 : ContextLifecycleObserver(executionContext)
14 { 16 {
15 } 17 }
16 18
17 Presentation::~Presentation() 19 Presentation::~Presentation()
18 { 20 {
(...skipping 13 matching lines...) Expand all
32 ExecutionContext* Presentation::executionContext() const 34 ExecutionContext* Presentation::executionContext() const
33 { 35 {
34 return ContextLifecycleObserver::executionContext(); 36 return ContextLifecycleObserver::executionContext();
35 } 37 }
36 38
37 void Presentation::trace(Visitor* visitor) 39 void Presentation::trace(Visitor* visitor)
38 { 40 {
39 EventTargetWithInlineData::trace(visitor); 41 EventTargetWithInlineData::trace(visitor);
40 } 42 }
41 43
44 PresentationSession* Presentation::session() const
45 {
46 return m_session.get();
Peter Beverloo 2014/10/29 20:51:19 visitor->trace(m_session);
whywhat 2014/10/29 22:09:26 Done.
47 }
48
49 ScriptPromise Presentation::startSession(ScriptState* state, const String& sende rId, const String& presentationId)
50 {
51 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state );
52 ScriptPromise promise = resolver->promise();
53 RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(NotSupport edError, "The method is not supported yet.");
54 resolver->reject(exception);
55 return promise;
56 }
57
58 ScriptPromise Presentation::joinSession(ScriptState* state, const String& sender Id, const String& presentationId)
59 {
60 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state );
61 ScriptPromise promise = resolver->promise();
62 RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(NotSupport edError, "The method is not supported yet.");
63 resolver->reject(exception);
Peter Beverloo 2014/10/29 20:51:19 Just call DOMException::create() as part of this c
whywhat 2014/10/29 22:09:26 Done.
64 return promise;
65 }
66
42 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698