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

Side by Side Diff: net/url_request/url_request_job.cc

Issue 1421983002: Include tab IDs when reporting data use accounting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_use_scoped_vector
Patch Set: Fixed external_data_use_observer test Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/base/network_delegate_impl.cc ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 955
956 void URLRequestJob::MaybeNotifyNetworkBytes() { 956 void URLRequestJob::MaybeNotifyNetworkBytes() {
957 if (!request_ || !network_delegate_) 957 if (!request_ || !network_delegate_)
958 return; 958 return;
959 959
960 // Report any new received bytes. 960 // Report any new received bytes.
961 int64_t total_received_bytes = GetTotalReceivedBytes(); 961 int64_t total_received_bytes = GetTotalReceivedBytes();
962 DCHECK_GE(total_received_bytes, last_notified_total_received_bytes_); 962 DCHECK_GE(total_received_bytes, last_notified_total_received_bytes_);
963 if (total_received_bytes > last_notified_total_received_bytes_) { 963 if (total_received_bytes > last_notified_total_received_bytes_) {
964 network_delegate_->NotifyNetworkBytesReceived( 964 network_delegate_->NotifyNetworkBytesReceived(
965 *request_, total_received_bytes - last_notified_total_received_bytes_); 965 request_, total_received_bytes - last_notified_total_received_bytes_);
966 } 966 }
967 last_notified_total_received_bytes_ = total_received_bytes; 967 last_notified_total_received_bytes_ = total_received_bytes;
968 968
969 // Report any new sent bytes. 969 // Report any new sent bytes.
970 int64_t total_sent_bytes = GetTotalSentBytes(); 970 int64_t total_sent_bytes = GetTotalSentBytes();
971 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); 971 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_);
972 if (total_sent_bytes > last_notified_total_sent_bytes_) { 972 if (total_sent_bytes > last_notified_total_sent_bytes_) {
973 network_delegate_->NotifyNetworkBytesSent( 973 network_delegate_->NotifyNetworkBytesSent(
974 *request_, total_sent_bytes - last_notified_total_sent_bytes_); 974 request_, total_sent_bytes - last_notified_total_sent_bytes_);
975 } 975 }
976 last_notified_total_sent_bytes_ = total_sent_bytes; 976 last_notified_total_sent_bytes_ = total_sent_bytes;
977 } 977 }
978 978
979 } // namespace net 979 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate_impl.cc ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698