Index: components/data_use_measurement/content/data_use_user_data.h |
diff --git a/components/data_use_measurement/content/data_use_user_data.h b/components/data_use_measurement/content/data_use_user_data.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a33646bb52e4b767f6c4dd395d84552abcf9b5a6 |
--- /dev/null |
+++ b/components/data_use_measurement/content/data_use_user_data.h |
@@ -0,0 +1,35 @@ |
+// 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. |
+ |
+#ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
+#define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
+ |
+#include "base/supports_user_data.h" |
+ |
+namespace data_use_measurement { |
+// Used to annotate URLRequests with the service name if the URLRequest is used |
+// by a service. |
+class DataUseUserData : public base::SupportsUserData::Data { |
+ public: |
+ // This enum should be synced with DataUseServices enum in histograms.xml. |
+ // Please keep them synced after any updates. |
+ enum ServiceType { |
+ SUGGESTIONS, |
+ }; |
+ explicit DataUseUserData(ServiceType service_type); |
+ ~DataUseUserData() override; |
+ |
+ ServiceType service_type() const { return service_type_; } |
+ |
+ static const void* kUserDataKey; |
+ |
+ private: |
+ ServiceType service_type_; |
+}; |
+base::SupportsUserData::Data* CreateDataUseUserData( |
+ DataUseUserData::ServiceType service); |
+ |
+const char* ReturnServiceName(DataUseUserData::ServiceType service); |
+} // data_use_measurement namespace |
+#endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |