| OLD | NEW |
| 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 Loading... |
| 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(); | |
| 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 Loading... |
| 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 |
| OLD | NEW |