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

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

Issue 2643473002: [Presentation API] Allow PresentationConnection state change to "Connecting" (Closed)
Patch Set: Address Mark and Bin's comments 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/resources/presentation-service-mock.js ('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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 return m_url == url && m_id == id; 416 return m_url == url && m_id == id;
417 } 417 }
418 418
419 void PresentationConnection::didChangeState( 419 void PresentationConnection::didChangeState(
420 WebPresentationConnectionState state) { 420 WebPresentationConnectionState state) {
421 if (m_state == state) 421 if (m_state == state)
422 return; 422 return;
423 423
424 m_state = state; 424 m_state = state;
425 switch (m_state) { 425 switch (m_state) {
426 // There is no event handler for state changes to Connecting.
426 case WebPresentationConnectionState::Connecting: 427 case WebPresentationConnectionState::Connecting:
427 NOTREACHED();
428 return; 428 return;
429 case WebPresentationConnectionState::Connected: 429 case WebPresentationConnectionState::Connected:
430 dispatchStateChangeEvent(Event::create(EventTypeNames::connect)); 430 dispatchStateChangeEvent(Event::create(EventTypeNames::connect));
431 return; 431 return;
432 case WebPresentationConnectionState::Terminated: 432 case WebPresentationConnectionState::Terminated:
433 dispatchStateChangeEvent(Event::create(EventTypeNames::terminate)); 433 dispatchStateChangeEvent(Event::create(EventTypeNames::terminate));
434 return; 434 return;
435 // Closed state is handled in |didClose()|. 435 // Closed state is handled in |didClose()|.
436 case WebPresentationConnectionState::Closed: 436 case WebPresentationConnectionState::Closed:
437 NOTREACHED(); 437 NOTREACHED();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 void PresentationConnection::tearDown() { 494 void PresentationConnection::tearDown() {
495 // Cancel current Blob loading if any. 495 // Cancel current Blob loading if any.
496 if (m_blobLoader) { 496 if (m_blobLoader) {
497 m_blobLoader->cancel(); 497 m_blobLoader->cancel();
498 m_blobLoader.clear(); 498 m_blobLoader.clear();
499 } 499 }
500 m_messages.clear(); 500 m_messages.clear();
501 } 501 }
502 502
503 } // namespace blink 503 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698