| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 // Closed state is handled in |didClose()|. | 452 // Closed state is handled in |didClose()|. |
| 453 case WebPresentationConnectionState::Closed: | 453 case WebPresentationConnectionState::Closed: |
| 454 NOTREACHED(); | 454 NOTREACHED(); |
| 455 return; | 455 return; |
| 456 } | 456 } |
| 457 NOTREACHED(); | 457 NOTREACHED(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void PresentationConnection::didClose( | 460 void PresentationConnection::didClose( |
| 461 WebPresentationConnectionCloseReason reason, | 461 WebPresentationConnectionCloseReason reason, |
| 462 const String& message) { | 462 const WebString& message) { |
| 463 if (m_state == WebPresentationConnectionState::Closed) | 463 if (m_state == WebPresentationConnectionState::Closed) |
| 464 return; | 464 return; |
| 465 | 465 |
| 466 m_state = WebPresentationConnectionState::Closed; | 466 m_state = WebPresentationConnectionState::Closed; |
| 467 dispatchStateChangeEvent(PresentationConnectionCloseEvent::create( | 467 dispatchStateChangeEvent(PresentationConnectionCloseEvent::create( |
| 468 EventTypeNames::close, connectionCloseReasonToString(reason), message)); | 468 EventTypeNames::close, connectionCloseReasonToString(reason), message)); |
| 469 } | 469 } |
| 470 | 470 |
| 471 void PresentationConnection::didFinishLoadingBlob(DOMArrayBuffer* buffer) { | 471 void PresentationConnection::didFinishLoadingBlob(DOMArrayBuffer* buffer) { |
| 472 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob); | 472 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 void PresentationConnection::tearDown() { | 512 void PresentationConnection::tearDown() { |
| 513 // Cancel current Blob loading if any. | 513 // Cancel current Blob loading if any. |
| 514 if (m_blobLoader) { | 514 if (m_blobLoader) { |
| 515 m_blobLoader->cancel(); | 515 m_blobLoader->cancel(); |
| 516 m_blobLoader.clear(); | 516 m_blobLoader.clear(); |
| 517 } | 517 } |
| 518 m_messages.clear(); | 518 m_messages.clear(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 } // namespace blink | 521 } // namespace blink |
| OLD | NEW |