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

Unified Diff: net/base/upload_element_reader.h

Issue 10913179: net: Make UploadDataStream::Init() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 3 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: net/base/upload_element_reader.h
diff --git a/net/base/upload_element_reader.h b/net/base/upload_element_reader.h
index 3e8bceab90f7cc3ad4ffff24828c091b1c432bba..5af2e23f7abe27b980a5ac3463dcc7fbb76b3307 100644
--- a/net/base/upload_element_reader.h
+++ b/net/base/upload_element_reader.h
@@ -6,6 +6,7 @@
#define NET_BASE_UPLOAD_ELEMENT_READER_H_
#include "base/basictypes.h"
+#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
namespace net {
@@ -21,7 +22,12 @@ class NET_EXPORT UploadElementReader {
// Creates an appropriate UploadElementReader instance for the given element.
static UploadElementReader* Create(const UploadElement& element);
- // Initializes the instance synchronously.
+ // Initializes the instance synchronously when possible, otherwise does
+ // initialization aynschronously, returns ERR_IO_PENDING and runs callback.
+ virtual int Init(const CompletionCallback& callback) = 0;
+
+ // Initializes the instance always synchronously.
+ // Use this method only in tests and Chrome Frame.
virtual int InitSync() = 0;
// Returns the byte-length of the element. For files that do not exist, 0

Powered by Google App Engine
This is Rietveld 408576698