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..f169deb7ceb5beaf973a8a738f02e6903eea2bc4 |
--- /dev/null |
+++ b/components/data_use_measurement/content/data_use_user_data.h |
@@ -0,0 +1,29 @@ |
+// Copyright (c) 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_ |
sclittle
2015/08/21 23:55:34
This file and it's .cc file should be in "data_use
amohammadkhan
2015/08/26 22:28:40
Done.
|
+#define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
+ |
+#include <string> |
+ |
+#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: |
+ explicit DataUseUserData(std::string service_name); |
+ ~DataUseUserData() override; |
+ |
+ std::string service_name() const { return service_name_; } |
+ |
+ static const void* kUserDataKey; |
+ |
+ private: |
+ std::string service_name_; |
sclittle
2015/08/21 23:55:34
Instead of holding a string, could you create an e
amohammadkhan
2015/08/24 23:18:47
You are right. We had a problem about a good place
|
+}; |
+base::SupportsUserData::Data* CreateDataUseUserData(std::string service_name); |
+} // data_use_measurement namespace |
+#endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |