summaryrefslogtreecommitdiffstats
path: root/components/invalidation
diff options
context:
space:
mode:
authoramohammadkhan <amohammadkhan@google.com>2015-09-14 10:34:43 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-14 17:35:19 +0000
commitf76ae11f25dc0056cea63e15c16039fdbd5f3470 (patch)
treefd1285923858b8b5ed211c405aefd9ec9cb98106 /components/invalidation
parent7ba3d6825c0bb7ce3eee3b4fae4a3fa7325d5e11 (diff)
downloadchromium_src-f76ae11f25dc0056cea63e15c16039fdbd5f3470.zip
chromium_src-f76ae11f25dc0056cea63e15c16039fdbd5f3470.tar.gz
chromium_src-f76ae11f25dc0056cea63e15c16039fdbd5f3470.tar.bz2
Report data usage UMA for Chrome services
This issue has the same goals as issue 1330443002( It was reverted because it breaded compile on multiple bots). 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,pkasting@chromium.org,sclittle@chromium.org,thestig@chromium.org,isherman@chromium.org,rouslan@chromium.org,nyquist@chromium.org,bengr@chromium.org,asvltkine@chromium.org,zea@chromium.org,mmenke@chromium.org BUG=527304 Review URL: https://codereview.chromium.org/1336333003 Cr-Commit-Position: refs/heads/master@{#348645}
Diffstat (limited to 'components/invalidation')
-rw-r--r--components/invalidation/impl/BUILD.gn1
-rw-r--r--components/invalidation/impl/DEPS1
-rw-r--r--components/invalidation/impl/gcm_network_channel.cc3
3 files changed, 5 insertions, 0 deletions
diff --git a/components/invalidation/impl/BUILD.gn b/components/invalidation/impl/BUILD.gn
index 20034c1..bf1b917 100644
--- a/components/invalidation/impl/BUILD.gn
+++ b/components/invalidation/impl/BUILD.gn
@@ -68,6 +68,7 @@ source_set("impl") {
"//base",
"//base:i18n",
"//base:prefs",
+ "//components/data_use_measurement/core",
"//components/gcm_driver",
"//components/keyed_service/core",
"//components/pref_registry",
diff --git a/components/invalidation/impl/DEPS b/components/invalidation/impl/DEPS
index 285832f..5fb7f26 100644
--- a/components/invalidation/impl/DEPS
+++ b/components/invalidation/impl/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+components/invalidation/public",
+ "+components/data_use_measurement/core",
"+components/gcm_driver",
"+components/keyed_service",
"+components/pref_registry",
diff --git a/components/invalidation/impl/gcm_network_channel.cc b/components/invalidation/impl/gcm_network_channel.cc
index ebe9e59..7e664464 100644
--- a/components/invalidation/impl/gcm_network_channel.cc
+++ b/components/invalidation/impl/gcm_network_channel.cc
@@ -19,6 +19,7 @@
#include "google/cacheinvalidation/channel_common.pb.h"
#include "google/cacheinvalidation/types.pb.h"
#endif
+#include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/invalidation/impl/gcm_network_channel.h"
#include "components/invalidation/impl/gcm_network_channel_delegate.h"
#include "google_apis/gaia/google_service_auth_error.h"
@@ -211,6 +212,8 @@ void GCMNetworkChannel::OnGetTokenComplete(
DVLOG(2) << "Got access token, sending message";
fetcher_ = net::URLFetcher::Create(BuildUrl(registration_id_),
net::URLFetcher::POST, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ fetcher_.get(), data_use_measurement::DataUseUserData::INVALIDATION);
fetcher_->SetRequestContext(request_context_getter_.get());
const std::string auth_header("Authorization: Bearer " + access_token_);
fetcher_->AddExtraRequestHeader(auth_header);