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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 2691773002: [Presentation API] Remove state transition from PresentationConnection::take() (Closed)
Patch Set: update layout test to check initial state of presentation connection Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/presentation/presentation-start.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "modules/presentation/PresentationConnection.h" 5 #include "modules/presentation/PresentationConnection.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 controller->registerConnection(connection); 202 controller->registerConnection(connection);
203 203
204 // Fire onconnectionavailable event asynchronously. 204 // Fire onconnectionavailable event asynchronously.
205 auto* event = PresentationConnectionAvailableEvent::create( 205 auto* event = PresentationConnectionAvailableEvent::create(
206 EventTypeNames::connectionavailable, connection); 206 EventTypeNames::connectionavailable, connection);
207 request->getExecutionContext()->postTask( 207 request->getExecutionContext()->postTask(
208 TaskType::Presentation, BLINK_FROM_HERE, 208 TaskType::Presentation, BLINK_FROM_HERE,
209 createSameThreadTask(&PresentationConnection::dispatchEventAsync, 209 createSameThreadTask(&PresentationConnection::dispatchEventAsync,
210 wrapPersistent(request), wrapPersistent(event))); 210 wrapPersistent(request), wrapPersistent(event)));
211 211
212 // Fire onconnect event asynchronously, after onconnectionavailable.
213 connection->didChangeState(WebPresentationConnectionState::Connected);
214
215 return connection; 212 return connection;
216 } 213 }
217 214
218 // static 215 // static
219 PresentationConnection* PresentationConnection::take( 216 PresentationConnection* PresentationConnection::take(
220 PresentationReceiver* receiver, 217 PresentationReceiver* receiver,
221 const WebPresentationSessionInfo& sessionInfo) { 218 const WebPresentationSessionInfo& sessionInfo) {
222 DCHECK(receiver); 219 DCHECK(receiver);
223 220
224 PresentationConnection* connection = new PresentationConnection( 221 PresentationConnection* connection = new PresentationConnection(
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 void PresentationConnection::tearDown() { 505 void PresentationConnection::tearDown() {
509 // Cancel current Blob loading if any. 506 // Cancel current Blob loading if any.
510 if (m_blobLoader) { 507 if (m_blobLoader) {
511 m_blobLoader->cancel(); 508 m_blobLoader->cancel();
512 m_blobLoader.clear(); 509 m_blobLoader.clear();
513 } 510 }
514 m_messages.clear(); 511 m_messages.clear();
515 } 512 }
516 513
517 } // namespace blink 514 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/presentation/presentation-start.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698