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

Unified Diff: trunk/src/net/base/upload_file_element_reader.h

Issue 139263007: Revert 244857 "net: Remove classes which were used only by Chrom..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/net/base/upload_data.cc ('k') | trunk/src/net/base/upload_file_element_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/base/upload_file_element_reader.h
===================================================================
--- trunk/src/net/base/upload_file_element_reader.h (revision 244981)
+++ trunk/src/net/base/upload_file_element_reader.h (working copy)
@@ -106,6 +106,37 @@
DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader);
};
+// An UploadElementReader implementation for file which performs file operation
+// synchronously.
+// Use this class only if the thread is IO allowed.
+class NET_EXPORT UploadFileElementReaderSync : public UploadElementReader {
+ public:
+ UploadFileElementReaderSync(const base::FilePath& path,
+ uint64 range_offset,
+ uint64 range_length,
+ const base::Time& expected_modification_time);
+ virtual ~UploadFileElementReaderSync();
+
+ // UploadElementReader overrides:
+ virtual int Init(const CompletionCallback& callback) OVERRIDE;
+ virtual uint64 GetContentLength() const OVERRIDE;
+ virtual uint64 BytesRemaining() const OVERRIDE;
+ virtual int Read(IOBuffer* buf,
+ int buf_length,
+ const CompletionCallback& callback) OVERRIDE;
+
+ private:
+ const base::FilePath path_;
+ const uint64 range_offset_;
+ const uint64 range_length_;
+ const base::Time expected_modification_time_;
+ scoped_ptr<FileStream> file_stream_;
+ uint64 content_length_;
+ uint64 bytes_remaining_;
+
+ DISALLOW_COPY_AND_ASSIGN(UploadFileElementReaderSync);
+};
+
} // namespace net
#endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
« no previous file with comments | « trunk/src/net/base/upload_data.cc ('k') | trunk/src/net/base/upload_file_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698