| 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 #include "modules/fetch/FormDataBytesConsumer.h" | 5 #include "modules/fetch/FormDataBytesConsumer.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMArrayBuffer.h" | 7 #include "core/dom/DOMArrayBuffer.h" |
| 8 #include "core/dom/DOMArrayBufferView.h" | 8 #include "core/dom/DOMArrayBufferView.h" |
| 9 #include "modules/fetch/BlobBytesConsumer.h" | 9 #include "modules/fetch/BlobBytesConsumer.h" |
| 10 #include "platform/blob/BlobData.h" | 10 #include "platform/blob/BlobData.h" |
| 11 #include "platform/network/EncodedFormData.h" | 11 #include "platform/network/EncodedFormData.h" |
| 12 #include "wtf/Vector.h" | 12 #include "platform/wtf/Vector.h" |
| 13 #include "wtf/text/TextCodec.h" | 13 #include "platform/wtf/text/TextCodec.h" |
| 14 #include "wtf/text/TextEncoding.h" | 14 #include "platform/wtf/text/TextEncoding.h" |
| 15 #include "wtf/text/WTFString.h" | 15 #include "platform/wtf/text/WTFString.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 bool IsSimple(const EncodedFormData* form_data) { | 21 bool IsSimple(const EncodedFormData* form_data) { |
| 22 for (const auto& element : form_data->Elements()) { | 22 for (const auto& element : form_data->Elements()) { |
| 23 if (element.type_ != FormDataElement::kData) | 23 if (element.type_ != FormDataElement::kData) |
| 24 return false; | 24 return false; |
| 25 } | 25 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 BytesConsumer* consumer) | 236 BytesConsumer* consumer) |
| 237 : impl_(IsSimple(form_data.Get()) | 237 : impl_(IsSimple(form_data.Get()) |
| 238 ? static_cast<BytesConsumer*>( | 238 ? static_cast<BytesConsumer*>( |
| 239 new SimpleFormDataBytesConsumer(std::move(form_data))) | 239 new SimpleFormDataBytesConsumer(std::move(form_data))) |
| 240 : static_cast<BytesConsumer*>( | 240 : static_cast<BytesConsumer*>( |
| 241 new ComplexFormDataBytesConsumer(execution_context, | 241 new ComplexFormDataBytesConsumer(execution_context, |
| 242 std::move(form_data), | 242 std::move(form_data), |
| 243 consumer))) {} | 243 consumer))) {} |
| 244 | 244 |
| 245 } // namespace blink | 245 } // namespace blink |
| OLD | NEW |