| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |