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

Unified Diff: net/url_request/url_request.h

Issue 18390: Change URLRequest to use a ref-counted buffer for actual IO.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « net/url_request/mime_sniffer_proxy.cc ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.h
===================================================================
--- net/url_request/url_request.h (revision 8565)
+++ net/url_request/url_request.h (working copy)
@@ -21,6 +21,9 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_status.h"
+namespace net {
+class IOBuffer;
+}
class URLRequestJob;
// This stores the values of the Set-Cookie headers received during the request.
@@ -367,16 +370,14 @@
// successful status.
// If data is available, Read will return true, and the data and length will
// be returned immediately. If data is not available, Read returns false,
- // and an asynchronous Read is initiated. The caller guarantees the
- // buffer provided will be available until the Read is finished. The
- // Read is finished when the caller receives the OnReadComplete
- // callback. OnReadComplete will be always be called, even if there
- // was a failure.
+ // and an asynchronous Read is initiated. The Read is finished when
+ // the caller receives the OnReadComplete callback. OnReadComplete will be
+ // always be called, even if there was a failure.
//
- // The buf parameter is a buffer to receive the data. Once the read is
- // initiated, the caller guarantees availability of this buffer until
- // the OnReadComplete is received. The buffer must be at least
- // max_bytes in length.
+ // The buf parameter is a buffer to receive the data. If the operation
+ // completes asynchronously, the implementation will reference the buffer
+ // until OnReadComplete is called. The buffer must be at least max_bytes in
+ // length.
//
// The max_bytes parameter is the maximum number of bytes to read.
//
@@ -386,7 +387,7 @@
//
// If a read error occurs, Read returns false and the request->status
// will be set to an error.
- bool Read(char* buf, int max_bytes, int *bytes_read);
+ bool Read(net::IOBuffer* buf, int max_bytes, int *bytes_read);
// One of the following two methods should be called in response to an
// OnAuthRequired() callback (and only then).
« no previous file with comments | « net/url_request/mime_sniffer_proxy.cc ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698