| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 class PresentationConnection::Message final | 95 class PresentationConnection::Message final |
| 96 : public GarbageCollectedFinalized<PresentationConnection::Message> { | 96 : public GarbageCollectedFinalized<PresentationConnection::Message> { |
| 97 public: | 97 public: |
| 98 Message(const String& text) : type(MessageTypeText), text(text) {} | 98 Message(const String& text) : type(MessageTypeText), text(text) {} |
| 99 | 99 |
| 100 Message(DOMArrayBuffer* arrayBuffer) | 100 Message(DOMArrayBuffer* arrayBuffer) |
| 101 : type(MessageTypeArrayBuffer), arrayBuffer(arrayBuffer) {} | 101 : type(MessageTypeArrayBuffer), arrayBuffer(arrayBuffer) {} |
| 102 | 102 |
| 103 Message(PassRefPtr<BlobDataHandle> blobDataHandle) | 103 Message(PassRefPtr<BlobDataHandle> blobDataHandle) |
| 104 : type(MessageTypeBlob), blobDataHandle(blobDataHandle) {} | 104 : type(MessageTypeBlob), blobDataHandle(std::move(blobDataHandle)) {} |
| 105 | 105 |
| 106 DEFINE_INLINE_TRACE() { visitor->trace(arrayBuffer); } | 106 DEFINE_INLINE_TRACE() { visitor->trace(arrayBuffer); } |
| 107 | 107 |
| 108 MessageType type; | 108 MessageType type; |
| 109 String text; | 109 String text; |
| 110 Member<DOMArrayBuffer> arrayBuffer; | 110 Member<DOMArrayBuffer> arrayBuffer; |
| 111 RefPtr<BlobDataHandle> blobDataHandle; | 111 RefPtr<BlobDataHandle> blobDataHandle; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 class PresentationConnection::BlobLoader final | 114 class PresentationConnection::BlobLoader final |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 void PresentationConnection::tearDown() { | 515 void PresentationConnection::tearDown() { |
| 516 // Cancel current Blob loading if any. | 516 // Cancel current Blob loading if any. |
| 517 if (m_blobLoader) { | 517 if (m_blobLoader) { |
| 518 m_blobLoader->cancel(); | 518 m_blobLoader->cancel(); |
| 519 m_blobLoader.clear(); | 519 m_blobLoader.clear(); |
| 520 } | 520 } |
| 521 m_messages.clear(); | 521 m_messages.clear(); |
| 522 } | 522 } |
| 523 | 523 |
| 524 } // namespace blink | 524 } // namespace blink |
| OLD | NEW |