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

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: changed argument order 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
« no previous file with comments | « net/base/upload_data_stream_unittest.cc ('k') | net/base/upload_element_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..acb1ecabe4ac73089f80c6abc7e8a2b990a4a8d6 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,8 +22,13 @@ class NET_EXPORT UploadElementReader {
// Creates an appropriate UploadElementReader instance for the given element.
static UploadElementReader* Create(const UploadElement& element);
- // Initializes the instance synchronously.
- virtual int InitSync() = 0;
+ // 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();
// Returns the byte-length of the element. For files that do not exist, 0
// is returned. This is done for consistency with Mozilla.
« no previous file with comments | « net/base/upload_data_stream_unittest.cc ('k') | net/base/upload_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698