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

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

Issue 1322123002: Presentation API: rename PresentationRequest.join() to reconnect(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test Created 5 years, 3 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/PresentationRequest.h" 6 #include "modules/presentation/PresentationRequest.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 WebPresentationClient* client = presentationClient(executionContext()); 91 WebPresentationClient* client = presentationClient(executionContext());
92 if (!client) { 92 if (!client) {
93 resolver->reject(DOMException::create(InvalidStateError, "The Presentati onRequest is no longer associated to a frame.")); 93 resolver->reject(DOMException::create(InvalidStateError, "The Presentati onRequest is no longer associated to a frame."));
94 return promise; 94 return promise;
95 } 95 }
96 client->startSession(m_url.string(), new PresentationSessionCallbacks(resolv er, this)); 96 client->startSession(m_url.string(), new PresentationSessionCallbacks(resolv er, this));
97 97
98 return promise; 98 return promise;
99 } 99 }
100 100
101 ScriptPromise PresentationRequest::join(ScriptState* scriptState, const String& id) 101 ScriptPromise PresentationRequest::reconnect(ScriptState* scriptState, const Str ing& id)
102 { 102 {
103 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 103 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
104 ScriptPromise promise = resolver->promise(); 104 ScriptPromise promise = resolver->promise();
105 105
106 WebPresentationClient* client = presentationClient(executionContext()); 106 WebPresentationClient* client = presentationClient(executionContext());
107 if (!client) { 107 if (!client) {
108 resolver->reject(DOMException::create(InvalidStateError, "The Presentati onRequest is no longer associated to a frame.")); 108 resolver->reject(DOMException::create(InvalidStateError, "The Presentati onRequest is no longer associated to a frame."));
109 return promise; 109 return promise;
110 } 110 }
111 client->joinSession(m_url.string(), id, new PresentationSessionCallbacks(res olver, this)); 111 client->joinSession(m_url.string(), id, new PresentationSessionCallbacks(res olver, this));
(...skipping 26 matching lines...) Expand all
138 ActiveDOMObject::trace(visitor); 138 ActiveDOMObject::trace(visitor);
139 } 139 }
140 140
141 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con st KURL& url) 141 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con st KURL& url)
142 : ActiveDOMObject(executionContext) 142 : ActiveDOMObject(executionContext)
143 , m_url(url) 143 , m_url(url)
144 { 144 {
145 } 145 }
146 146
147 } // namespace blink 147 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/presentation/PresentationRequest.h ('k') | Source/modules/presentation/PresentationRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698