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

Unified Diff: net/url_request/url_request_job.cc

Issue 7084007: Adds URLRequestJob bytes read to NetLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 9 years, 7 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
Index: net/url_request/url_request_job.cc
===================================================================
--- net/url_request/url_request_job.cc (revision 87467)
+++ net/url_request/url_request_job.cc (working copy)
@@ -530,6 +530,13 @@
<< " pre total = " << prefilter_bytes_read_
<< " post total = "
<< postfilter_bytes_read_;
+ // If logging all bytes is enabled, log the filtered bytes read.
+ if (rv && request() && request()->net_log().IsLoggingBytes() &&
+ filtered_data_len > 0) {
+ request()->net_log().AddByteTransferEvent(
+ NetLog::TYPE_URL_REQUEST_JOB_FILTERED_BYTES_READ,
+ filtered_data_len, filtered_read_buffer_->data());
+ }
} else {
// we are done, or there is no data left.
rv = true;
@@ -588,6 +595,15 @@
bool rv = ReadRawData(buf, buf_size, bytes_read);
if (!request_->status().is_io_pending()) {
+ // If |filter_| is NULL, and logging all bytes is enabled, log the raw
+ // bytes read.
+ if (!filter_.get() && request() && request()->net_log().IsLoggingBytes() &&
+ *bytes_read > 0) {
+ request()->net_log().AddByteTransferEvent(
+ NetLog::TYPE_URL_REQUEST_JOB_BYTES_READ,
+ *bytes_read, raw_read_buffer_->data());
+ }
+
// If the read completes synchronously, either success or failure,
// invoke the OnRawReadComplete callback so we can account for the
// completed read.
« chrome/browser/net/passive_log_collector.cc ('K') | « net/socket/tcp_client_socket_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698