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

Unified Diff: net/url_request/url_request_job.h

Issue 3010037: Add the actual data being read to the OnBytesRead callback, take two.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 4 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/net.gyp ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job.h
===================================================================
--- net/url_request/url_request_job.h (revision 55065)
+++ net/url_request/url_request_job.h (working copy)
@@ -313,13 +313,23 @@
// an error occurred (or we are waiting for IO to complete).
bool ReadRawDataForFilter(int *bytes_read);
+ // Invokes ReadRawData and records bytes read if the read completes
+ // synchronously.
+ bool ReadRawDataHelper(net::IOBuffer* buf, int buf_size, int* bytes_read);
+
// Called in response to a redirect that was not canceled to follow the
// redirect. The current job will be replaced with a new job loading the
// given redirect destination.
void FollowRedirect(const GURL& location, int http_status_code);
- // Updates the profiling info and notifies observers that bytes_read bytes
- // have been read.
+ // Called after every raw read. If |bytes_read| is > 0, this indicates
+ // a successful read of |bytes_read| unfiltered bytes. If |bytes_read|
+ // is 0, this indicates that there is no additional data to read. If
+ // |bytes_read| is < 0, an error occurred and no bytes were read.
+ void OnRawReadComplete(int bytes_read);
+
+ // Updates the profiling info and notifies observers that an additional
+ // |bytes_read| unfiltered bytes have been read for this job.
void RecordBytesRead(int bytes_read);
// Called to query whether there is data available in the filter to be read
@@ -350,9 +360,13 @@
// processing the filtered data, we return the data in the caller's buffer.
// While the async IO is in progress, we save the user buffer here, and
// when the IO completes, we fill this in.
- scoped_refptr<net::IOBuffer> read_buffer_;
- int read_buffer_len_;
+ scoped_refptr<net::IOBuffer> filtered_read_buffer_;
+ int filtered_read_buffer_len_;
+ // We keep a pointer to the read buffer while asynchronous reads are
+ // in progress, so we are able to pass those bytes to job observers.
+ scoped_refptr<net::IOBuffer> raw_read_buffer_;
+
// Used by HandleResponseIfNecessary to track whether we've sent the
// OnResponseStarted callback and potentially redirect callbacks as well.
bool has_handled_response_;
@@ -378,7 +392,7 @@
// as gathered here is post-SSL, and post-cache-fetch, and does not reflect
// true packet arrival times in such cases.
- // Total number of bytes read from network (or cache) and and typically handed
+ // Total number of bytes read from network (or cache) and typically handed
// to filter to process. Used to histogram compression ratios, and error
// recovery scenarios in filters.
int64 filter_input_byte_count_;
« no previous file with comments | « net/net.gyp ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698