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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2269833002: Refactor the DataUseMeasurement class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More mechanical changes Created 4 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 | « no previous file | chrome/browser/precache/precache_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index fab1bca45883faefe4f971e2f78892b1b6eb9763..a63bce294dd07da460b6dcaf92aa9c2a811022d9 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -343,8 +343,7 @@ int ChromeNetworkDelegate::OnHeadersReceived(
void ChromeNetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
const GURL& new_location) {
-// Recording data use of request on redirects.
- data_use_measurement_.ReportDataUseUMA(request);
+ data_use_measurement_.OnBeforeRedirect(*request, new_location);
if (domain_reliability_monitor_)
domain_reliability_monitor_->OnBeforeRedirect(request);
extensions_delegate_->OnBeforeRedirect(request, new_location);
@@ -373,9 +372,7 @@ void ChromeNetworkDelegate::OnNetworkBytesSent(net::URLRequest* request,
void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request,
bool started) {
- // TODO(amohammadkhan): Verify that there is no double recording in data use
- // of redirected requests.
- data_use_measurement_.ReportDataUseUMA(request);
+ data_use_measurement_.OnCompleted(*request, started);
RecordNetworkErrorHistograms(request);
if (request->status().status() == net::URLRequestStatus::SUCCESS) {
« no previous file with comments | « no previous file | chrome/browser/precache/precache_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698