summaryrefslogtreecommitdiffstats
path: root/components/rappor/log_uploader.cc
diff options
context:
space:
mode:
authoramohammadkhan <amohammadkhan@google.com>2015-09-13 21:54:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-14 04:55:03 +0000
commitaa789c8328a65922859dfd8ca2d9b18212dc3c94 (patch)
tree6d5c9118ca8f7b7c2f1b215fb55a79b0f943da09 /components/rappor/log_uploader.cc
parent95b75ed50cbf6499f41915a10ea4c5b8a67e7818 (diff)
downloadchromium_src-aa789c8328a65922859dfd8ca2d9b18212dc3c94.zip
chromium_src-aa789c8328a65922859dfd8ca2d9b18212dc3c94.tar.gz
chromium_src-aa789c8328a65922859dfd8ca2d9b18212dc3c94.tar.bz2
Report data usage UMA for Chrome services
data_use_measurement is a component which records the data use of the services, if a DataUseUserData is attached to their request. Hence to measure and compare data use of different services, a small change is needed in the services' code where they create a URLFetcher. After creating a URLFetcher by a service, a proper tag for that service should be attached to the request. Besides the necessary changes in the service, the enum in DataUseUserData and the function returning the names based on this enum should be updated for different services too. Also the name of target services should be added to proper enum and histograms in histograms.xml file. Lastly the dependency files should be updated accordingly too. TBR=bartfab@chromium.org, andrewhayden@chromium.org, rogerta@chromium.org, isherman@chromium.org, rouslan@chromium.org, estade@chromium.org, nyquist@chromium.org, pkasting@chromium.org, zea@chromium.org, mmenke@chromium.org, bengr@chromium.org, timvolodine@chromium.org BUG=527304 Review URL: https://codereview.chromium.org/1330443002 Cr-Commit-Position: refs/heads/master@{#348561}
Diffstat (limited to 'components/rappor/log_uploader.cc')
-rw-r--r--components/rappor/log_uploader.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/rappor/log_uploader.cc b/components/rappor/log_uploader.cc
index 9211184..97ad3e4 100644
--- a/components/rappor/log_uploader.cc
+++ b/components/rappor/log_uploader.cc
@@ -6,6 +6,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_fetcher.h"
@@ -110,6 +111,8 @@ void LogUploader::StartScheduledUpload() {
has_callback_pending_ = true;
current_fetch_ =
net::URLFetcher::Create(server_url_, net::URLFetcher::POST, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ current_fetch_.get(), data_use_measurement::DataUseUserData::RAPPOR);
current_fetch_->SetRequestContext(request_context_.get());
current_fetch_->SetUploadData(mime_type_, queued_logs_.front());