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

Unified Diff: net/base/file_stream.h

Issue 9402014: net: FileStream::Read/Write() to take IOBuffer* instead of char* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix redirect_to_file_resource_handler.cc Created 8 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
« no previous file with comments | « content/browser/renderer_host/redirect_to_file_resource_handler.cc ('k') | net/base/file_stream_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream.h
diff --git a/net/base/file_stream.h b/net/base/file_stream.h
index 7017f30431cdec041f6cfc36fa1762619c409251..b9efb253ae479b95757f77abc900ad796a7d28cc 100644
--- a/net/base/file_stream.h
+++ b/net/base/file_stream.h
@@ -21,6 +21,8 @@ class FilePath;
namespace net {
+class IOBuffer;
+
// TODO(darin): Move this to a more generic location.
// This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
enum Whence {
@@ -87,9 +89,6 @@ class NET_EXPORT FileStream {
// callback will be notified on the current thread (via the MessageLoop)
// when the read has completed.
//
- // The memory pointed to by |buf| must remain valid until the callback is
- // notified. TODO(satorux): Use IOBuffer instead of char*.
- //
// It is valid to destroy or close the file stream while there is an
// asynchronous read in progress. That will cancel the read and allow
// the buffer to be freed.
@@ -98,7 +97,8 @@ class NET_EXPORT FileStream {
// in-flight asynchronous operation.
//
// This method must not be called if the stream was opened WRITE_ONLY.
- virtual int Read(char* buf, int buf_len, const CompletionCallback& callback);
+ virtual int Read(IOBuffer* buf, int buf_len,
+ const CompletionCallback& callback);
// Call this method to read data from the current stream position
// synchronously. Up to buf_len bytes will be copied into buf. (In
@@ -129,9 +129,6 @@ class NET_EXPORT FileStream {
// callback will be notified on the current thread (via the MessageLoop)
// when the write has completed.
//
- // The memory pointed to by |buf| must remain valid until the callback
- // is notified. TODO(satorux): Use IOBuffer instead of char*.
- //
// It is valid to destroy or close the file stream while there is an
// asynchronous write in progress. That will cancel the write and allow
// the buffer to be freed.
@@ -140,7 +137,7 @@ class NET_EXPORT FileStream {
// in-flight asynchronous operation.
//
// This method must not be called if the stream was opened READ_ONLY.
- virtual int Write(const char* buf, int buf_len,
+ virtual int Write(IOBuffer* buf, int buf_len,
const CompletionCallback& callback);
// Call this method to write data at the current stream position
@@ -181,12 +178,6 @@ class NET_EXPORT FileStream {
void SetBoundNetLogSource(const net::BoundNetLog& owner_bound_net_log);
private:
- // Helper functions used to implement reads and writes.
- int ReadInternal(char* buf, int buf_len,
- const CompletionCallback& callback);
- int WriteInternal(const char* buf, int buf_len,
- const CompletionCallback& callback);
-
class AsyncContext;
friend class AsyncContext;
friend class FileStreamTest;
« no previous file with comments | « content/browser/renderer_host/redirect_to_file_resource_handler.cc ('k') | net/base/file_stream_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698