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

Unified Diff: Source/modules/fetch/FetchDataConsumerHandle.h

Issue 1265413002: Introduce FetchFormDataConsumerHandle. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add (const void*, size_t) creation function Created 5 years, 4 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: Source/modules/fetch/FetchDataConsumerHandle.h
diff --git a/Source/modules/fetch/FetchDataConsumerHandle.h b/Source/modules/fetch/FetchDataConsumerHandle.h
index 6f811ab5398541ab309f4cf903f72641f99b1fe8..5703a4cae28e1b0b36d1c92f9c1954b81363fce1 100644
--- a/Source/modules/fetch/FetchDataConsumerHandle.h
+++ b/Source/modules/fetch/FetchDataConsumerHandle.h
@@ -7,6 +7,7 @@
#include "modules/ModulesExport.h"
#include "platform/blob/BlobData.h"
+#include "platform/network/FormData.h"
#include "public/platform/WebDataConsumerHandle.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
@@ -40,6 +41,16 @@ public:
// function is no-op.
// This function returns |nullptr| when called during two-phase read.
virtual PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(BlobSizePolicy = DisallowBlobWithInvalidSize) { return nullptr; }
+
+ // Drains the data as a FormData.
+ // This function returns a non-null form data when
+ // - The handle is made from a FormData-convertible type,
+ // - The reader is running on a suitable thread, and
hiroshige 2015/08/11 09:35:01 What is "a suitable thread"? Isn't this a general
yhirano 2015/08/11 11:36:01 Sorry the restriction was gone.
+ // - No data is read yet.
+ // After that read() / beginRead() will return |Done|.
hiroshige 2015/08/11 09:35:01 Please add "and drainAsBlobDataHandle() will retur
yhirano 2015/08/11 11:36:01 I rewrote comments.
+ // Otherwise this function does nothing and returns null.
+ // This function returns |nullptr| when called during two-phase read.
+ virtual PassRefPtr<FormData> drainAsFormData() { return nullptr; }
};
// TODO(yhirano): obtainReader() is currently non-virtual override, and

Powered by Google App Engine
This is Rietveld 408576698