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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 PresentationConnection::~PresentationConnection() { | 159 PresentationConnection::~PresentationConnection() { |
160 ASSERT(!m_blobLoader); | 160 ASSERT(!m_blobLoader); |
161 } | 161 } |
162 | 162 |
163 void PresentationConnection::bindProxy( | 163 void PresentationConnection::bindProxy( |
164 std::unique_ptr<WebPresentationConnectionProxy> proxy) { | 164 std::unique_ptr<WebPresentationConnectionProxy> proxy) { |
165 DCHECK(proxy); | 165 DCHECK(proxy); |
166 // TODO(zhaobin): Restore to DCHECK(!m_proxy) when reconnect() is properly | 166 // TODO(zhaobin): Restore to DCHECK(!m_proxy) when reconnect() is properly |
167 // implemented. | 167 // implemented. |
168 if (!m_proxy) | 168 m_proxy = std::move(proxy); |
169 m_proxy = std::move(proxy); | |
170 } | 169 } |
171 | 170 |
172 // static | 171 // static |
173 PresentationConnection* PresentationConnection::take( | 172 PresentationConnection* PresentationConnection::take( |
174 ScriptPromiseResolver* resolver, | 173 ScriptPromiseResolver* resolver, |
175 const WebPresentationSessionInfo& sessionInfo, | 174 const WebPresentationSessionInfo& sessionInfo, |
176 PresentationRequest* request) { | 175 PresentationRequest* request) { |
177 ASSERT(resolver); | 176 ASSERT(resolver); |
178 ASSERT(request); | 177 ASSERT(request); |
179 ASSERT(resolver->getExecutionContext()->isDocument()); | 178 ASSERT(resolver->getExecutionContext()->isDocument()); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 void PresentationConnection::tearDown() { | 508 void PresentationConnection::tearDown() { |
510 // Cancel current Blob loading if any. | 509 // Cancel current Blob loading if any. |
511 if (m_blobLoader) { | 510 if (m_blobLoader) { |
512 m_blobLoader->cancel(); | 511 m_blobLoader->cancel(); |
513 m_blobLoader.clear(); | 512 m_blobLoader.clear(); |
514 } | 513 } |
515 m_messages.clear(); | 514 m_messages.clear(); |
516 } | 515 } |
517 | 516 |
518 } // namespace blink | 517 } // namespace blink |
OLD | NEW |