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

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

Issue 2714783002: [Presentation API] (browser side) Implement reconnect() for 1-UA mode (Closed)
Patch Set: resolve code review comments from Derek and Mark Created 3 years, 9 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 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (m_state == state) 434 if (m_state == state)
435 return; 435 return;
436 436
437 m_state = state; 437 m_state = state;
438 438
439 if (!shouldDispatchEvent) 439 if (!shouldDispatchEvent)
440 return; 440 return;
441 441
442 switch (m_state) { 442 switch (m_state) {
443 case WebPresentationConnectionState::Connecting: 443 case WebPresentationConnectionState::Connecting:
444 NOTREACHED();
imcheng 2017/03/16 01:42:51 Why this change?
zhaobin 2017/03/16 18:50:30 reconnect() on the same connection object will cha
445 return; 444 return;
446 case WebPresentationConnectionState::Connected: 445 case WebPresentationConnectionState::Connected:
447 dispatchStateChangeEvent(Event::create(EventTypeNames::connect)); 446 dispatchStateChangeEvent(Event::create(EventTypeNames::connect));
448 return; 447 return;
449 case WebPresentationConnectionState::Terminated: 448 case WebPresentationConnectionState::Terminated:
450 dispatchStateChangeEvent(Event::create(EventTypeNames::terminate)); 449 dispatchStateChangeEvent(Event::create(EventTypeNames::terminate));
451 return; 450 return;
452 // Closed state is handled in |didClose()|. 451 // Closed state is handled in |didClose()|.
453 case WebPresentationConnectionState::Closed: 452 case WebPresentationConnectionState::Closed:
454 NOTREACHED(); 453 NOTREACHED();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 void PresentationConnection::tearDown() { 515 void PresentationConnection::tearDown() {
517 // Cancel current Blob loading if any. 516 // Cancel current Blob loading if any.
518 if (m_blobLoader) { 517 if (m_blobLoader) {
519 m_blobLoader->cancel(); 518 m_blobLoader->cancel();
520 m_blobLoader.clear(); 519 m_blobLoader.clear();
521 } 520 }
522 m_messages.clear(); 521 m_messages.clear();
523 } 522 }
524 523
525 } // namespace blink 524 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698