Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h

Issue 2710033003: Add unknown file size handling in ComplexFormDataBytesConsumer (Closed)
Patch Set: fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h
diff --git a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h
index 6a45d075b46253b2a2a1cfcd25729e1bcb534eb0..0ab47d7d5bdbee6b9f17e7e89126b9b9952a25e8 100644
--- a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h
+++ b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.h
@@ -9,6 +9,7 @@
#include "modules/fetch/BytesConsumer.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
+#include "wtf/Functional.h"
#include "wtf/PassRefPtr.h"
namespace blink {
@@ -19,6 +20,9 @@ class EncodedFormData;
class FormDataBytesConsumer final : public BytesConsumer {
public:
+ using BytesConsumerFactory =
+ Function<BytesConsumer*(ExecutionContext*, PassRefPtr<BlobDataHandle>)>;
+
explicit MODULES_EXPORT FormDataBytesConsumer(const String&);
explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBuffer*);
explicit MODULES_EXPORT FormDataBytesConsumer(DOMArrayBufferView*);
@@ -28,9 +32,9 @@ class FormDataBytesConsumer final : public BytesConsumer {
MODULES_EXPORT static FormDataBytesConsumer* createForTesting(
ExecutionContext* executionContext,
PassRefPtr<EncodedFormData> formData,
- BytesConsumer* consumer) {
+ std::unique_ptr<BytesConsumerFactory> factory) {
return new FormDataBytesConsumer(executionContext, std::move(formData),
- consumer);
+ std::move(factory));
}
// BytesConsumer implementation
@@ -64,7 +68,7 @@ class FormDataBytesConsumer final : public BytesConsumer {
private:
MODULES_EXPORT FormDataBytesConsumer(ExecutionContext*,
PassRefPtr<EncodedFormData>,
- BytesConsumer*);
+ std::unique_ptr<BytesConsumerFactory>);
const Member<BytesConsumer> m_impl;
};

Powered by Google App Engine
This is Rietveld 408576698