| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 Member<PresentationConnection> m_PresentationConnection; | 144 Member<PresentationConnection> m_PresentationConnection; |
| 145 std::unique_ptr<FileReaderLoader> m_loader; | 145 std::unique_ptr<FileReaderLoader> m_loader; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 PresentationConnection::PresentationConnection(LocalFrame* frame, | 148 PresentationConnection::PresentationConnection(LocalFrame* frame, |
| 149 const String& id, | 149 const String& id, |
| 150 const KURL& url) | 150 const KURL& url) |
| 151 : DOMWindowProperty(frame), | 151 : DOMWindowProperty(frame), |
| 152 m_id(id), | 152 m_id(id), |
| 153 m_url(url), | 153 m_url(url), |
| 154 // TODO(zhaobin): change initial state to Connecting. (crbug/659423) | 154 m_state(WebPresentationConnectionState::Connecting), |
| 155 m_state(WebPresentationConnectionState::Connected), | |
| 156 m_binaryType(BinaryTypeBlob) {} | 155 m_binaryType(BinaryTypeBlob) {} |
| 157 | 156 |
| 158 PresentationConnection::~PresentationConnection() { | 157 PresentationConnection::~PresentationConnection() { |
| 159 ASSERT(!m_blobLoader); | 158 ASSERT(!m_blobLoader); |
| 160 } | 159 } |
| 161 | 160 |
| 162 // static | 161 // static |
| 163 PresentationConnection* PresentationConnection::take( | 162 PresentationConnection* PresentationConnection::take( |
| 164 ScriptPromiseResolver* resolver, | 163 ScriptPromiseResolver* resolver, |
| 165 std::unique_ptr<WebPresentationConnectionClient> client, | 164 std::unique_ptr<WebPresentationConnectionClient> client, |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 void PresentationConnection::tearDown() { | 467 void PresentationConnection::tearDown() { |
| 469 // Cancel current Blob loading if any. | 468 // Cancel current Blob loading if any. |
| 470 if (m_blobLoader) { | 469 if (m_blobLoader) { |
| 471 m_blobLoader->cancel(); | 470 m_blobLoader->cancel(); |
| 472 m_blobLoader.clear(); | 471 m_blobLoader.clear(); |
| 473 } | 472 } |
| 474 m_messages.clear(); | 473 m_messages.clear(); |
| 475 } | 474 } |
| 476 | 475 |
| 477 } // namespace blink | 476 } // namespace blink |
| OLD | NEW |