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

Unified Diff: components/precache/core/precache_fetcher.cc

Issue 2274243002: Add data usage tracking for data reduction proxy, precache services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 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 | « components/precache/core/DEPS ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/precache_fetcher.cc
diff --git a/components/precache/core/precache_fetcher.cc b/components/precache/core/precache_fetcher.cc
index 377594a7e599c79a1fa52cb3ef6e0c465f747f9e..437c3094ee7709ca857652bc8a6cab4ac0e23dac 100644
--- a/components/precache/core/precache_fetcher.cc
+++ b/components/precache/core/precache_fetcher.cc
@@ -24,6 +24,7 @@
#include "base/sha1.h"
#include "base/strings/string_piece.h"
#include "base/task_runner_util.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/precache/core/precache_database.h"
#include "components/precache/core/precache_switches.h"
#include "components/precache/core/proto/precache.pb.h"
@@ -254,6 +255,9 @@ void PrecacheFetcher::Fetcher::LoadFromCache() {
fetch_stage_ = FetchStage::CACHE;
cache_url_fetcher_ =
net::URLFetcher::Create(url_, net::URLFetcher::GET, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ cache_url_fetcher_.get(),
+ data_use_measurement::DataUseUserData::PRECACHE);
cache_url_fetcher_->SetRequestContext(request_context_);
cache_url_fetcher_->SetLoadFlags(net::LOAD_ONLY_FROM_CACHE | kNoTracking);
std::unique_ptr<URLFetcherNullWriter> null_writer(new URLFetcherNullWriter);
@@ -265,6 +269,9 @@ void PrecacheFetcher::Fetcher::LoadFromNetwork() {
fetch_stage_ = FetchStage::NETWORK;
network_url_fetcher_ =
net::URLFetcher::Create(url_, net::URLFetcher::GET, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ network_url_fetcher_.get(),
+ data_use_measurement::DataUseUserData::PRECACHE);
network_url_fetcher_->SetRequestContext(request_context_);
if (is_resource_request_) {
// LOAD_VALIDATE_CACHE allows us to refresh Date headers for resources
« no previous file with comments | « components/precache/core/DEPS ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698