| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 void PresentationConnection::send(DOMArrayBuffer* arrayBuffer, | 273 void PresentationConnection::send(DOMArrayBuffer* arrayBuffer, |
| 274 ExceptionState& exceptionState) { | 274 ExceptionState& exceptionState) { |
| 275 ASSERT(arrayBuffer && arrayBuffer->buffer()); | 275 ASSERT(arrayBuffer && arrayBuffer->buffer()); |
| 276 if (!canSendMessage(exceptionState)) | 276 if (!canSendMessage(exceptionState)) |
| 277 return; | 277 return; |
| 278 | 278 |
| 279 m_messages.push_back(new Message(arrayBuffer)); | 279 m_messages.push_back(new Message(arrayBuffer)); |
| 280 handleMessageQueue(); | 280 handleMessageQueue(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void PresentationConnection::send(DOMArrayBufferView* arrayBufferView, | 283 void PresentationConnection::send(NotShared<DOMArrayBufferView> arrayBufferView, |
| 284 ExceptionState& exceptionState) { | 284 ExceptionState& exceptionState) { |
| 285 ASSERT(arrayBufferView); | 285 DCHECK(arrayBufferView); |
| 286 if (!canSendMessage(exceptionState)) | 286 if (!canSendMessage(exceptionState)) |
| 287 return; | 287 return; |
| 288 | 288 |
| 289 m_messages.push_back(new Message(arrayBufferView->buffer())); | 289 m_messages.push_back(new Message(arrayBufferView.view()->buffer())); |
| 290 handleMessageQueue(); | 290 handleMessageQueue(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void PresentationConnection::send(Blob* data, ExceptionState& exceptionState) { | 293 void PresentationConnection::send(Blob* data, ExceptionState& exceptionState) { |
| 294 ASSERT(data); | 294 ASSERT(data); |
| 295 if (!canSendMessage(exceptionState)) | 295 if (!canSendMessage(exceptionState)) |
| 296 return; | 296 return; |
| 297 | 297 |
| 298 m_messages.push_back(new Message(data->blobDataHandle())); | 298 m_messages.push_back(new Message(data->blobDataHandle())); |
| 299 handleMessageQueue(); | 299 handleMessageQueue(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 void PresentationConnection::tearDown() { | 516 void PresentationConnection::tearDown() { |
| 517 // Cancel current Blob loading if any. | 517 // Cancel current Blob loading if any. |
| 518 if (m_blobLoader) { | 518 if (m_blobLoader) { |
| 519 m_blobLoader->cancel(); | 519 m_blobLoader->cancel(); |
| 520 m_blobLoader.clear(); | 520 m_blobLoader.clear(); |
| 521 } | 521 } |
| 522 m_messages.clear(); | 522 m_messages.clear(); |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace blink | 525 } // namespace blink |
| OLD | NEW |