OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef FormDataBytesConsumer_h | 5 #ifndef FormDataBytesConsumer_h |
6 #define FormDataBytesConsumer_h | 6 #define FormDataBytesConsumer_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "modules/fetch/BytesConsumer.h" | 9 #include "modules/fetch/BytesConsumer.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 explicit MODULES_EXPORT FormDataBytesConsumer(const String&); | 22 explicit MODULES_EXPORT FormDataBytesConsumer(const String&); |
23 explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBuffer*); | 23 explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBuffer*); |
24 explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBufferView*); | 24 explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBufferView*); |
25 MODULES_EXPORT FormDataBytesConsumer(const void* data, size_t); | 25 MODULES_EXPORT FormDataBytesConsumer(const void* data, size_t); |
26 MODULES_EXPORT FormDataBytesConsumer(ExecutionContext*, | 26 MODULES_EXPORT FormDataBytesConsumer(ExecutionContext*, |
27 PassRefPtr<EncodedFormData>); | 27 PassRefPtr<EncodedFormData>); |
28 MODULES_EXPORT static FormDataBytesConsumer* createForTesting( | 28 MODULES_EXPORT static FormDataBytesConsumer* createForTesting( |
29 ExecutionContext* executionContext, | 29 ExecutionContext* executionContext, |
30 PassRefPtr<EncodedFormData> formData, | 30 PassRefPtr<EncodedFormData> formData, |
31 BytesConsumer* consumer) { | 31 BytesConsumer* consumer) { |
32 return new FormDataBytesConsumer(executionContext, formData, consumer); | 32 return new FormDataBytesConsumer(executionContext, std::move(formData), |
| 33 consumer); |
33 } | 34 } |
34 | 35 |
35 // BytesConsumer implementation | 36 // BytesConsumer implementation |
36 Result beginRead(const char** buffer, size_t* available) override { | 37 Result beginRead(const char** buffer, size_t* available) override { |
37 return m_impl->beginRead(buffer, available); | 38 return m_impl->beginRead(buffer, available); |
38 } | 39 } |
39 Result endRead(size_t readSize) override { return m_impl->endRead(readSize); } | 40 Result endRead(size_t readSize) override { return m_impl->endRead(readSize); } |
40 PassRefPtr<BlobDataHandle> drainAsBlobDataHandle( | 41 PassRefPtr<BlobDataHandle> drainAsBlobDataHandle( |
41 BlobSizePolicy policy) override { | 42 BlobSizePolicy policy) override { |
42 return m_impl->drainAsBlobDataHandle(policy); | 43 return m_impl->drainAsBlobDataHandle(policy); |
(...skipping 21 matching lines...) Expand all Loading... |
64 MODULES_EXPORT FormDataBytesConsumer(ExecutionContext*, | 65 MODULES_EXPORT FormDataBytesConsumer(ExecutionContext*, |
65 PassRefPtr<EncodedFormData>, | 66 PassRefPtr<EncodedFormData>, |
66 BytesConsumer*); | 67 BytesConsumer*); |
67 | 68 |
68 const Member<BytesConsumer> m_impl; | 69 const Member<BytesConsumer> m_impl; |
69 }; | 70 }; |
70 | 71 |
71 } // namespace blink | 72 } // namespace blink |
72 | 73 |
73 #endif // FormDataBytesConsumer_h | 74 #endif // FormDataBytesConsumer_h |
OLD | NEW |