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

Unified Diff: components/data_use_measurement/content/data_use_user_data.cc

Issue 1279543002: Support needed to measure user and service traffic in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewHistogram
Patch Set: Addressing reviewer's comments but the ones related to making component Created 5 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
Index: components/data_use_measurement/content/data_use_user_data.cc
diff --git a/components/data_use_measurement/content/data_use_user_data.cc b/components/data_use_measurement/content/data_use_user_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bf0003d6501b6f82cea395e25cb515e918957984
--- /dev/null
+++ b/components/data_use_measurement/content/data_use_user_data.cc
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/data_use_measurement/content/data_use_user_data.h"
+
+namespace data_use_measurement {
+DataUseUserData::DataUseUserData(ServiceType service_type)
+ : service_type_(service_type) {}
+
+DataUseUserData::~DataUseUserData() {}
+
+// static
+const void* DataUseUserData::kUserDataKey =
+ static_cast<const void*>(&DataUseUserData::kUserDataKey);
+
+// Helper function to create DataUseUserData.
+base::SupportsUserData::Data* CreateDataUseUserData(
+ DataUseUserData::ServiceType service_type) {
+ return new DataUseUserData(service_type);
+}
+
+const char* ReturnServiceName(DataUseUserData::ServiceType service_type) {
+ switch (service_type) {
+ case DataUseUserData::SUGGESTIONS:
+ return "Suggestions";
+ default:
+ break;
sclittle 2015/08/24 23:59:34 nit: Just put the NOTREACHED here under "default".
amohammadkhan 2015/08/25 00:12:07 Done.
+ }
+ NOTREACHED() << "Not known servie type in DataUseUserData";
sclittle 2015/08/24 23:59:34 nit: spelling "servie"
amohammadkhan 2015/08/25 00:12:07 Done.
+ return "INVALID";
+}
+
+} // data_use_measurement namespace

Powered by Google App Engine
This is Rietveld 408576698