OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
| 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
| 7 |
| 8 #include "base/supports_user_data.h" |
| 9 |
| 10 namespace data_use_measurement { |
| 11 // Used to annotate URLRequests with the service name if the URLRequest is used |
| 12 // by a service. |
| 13 class DataUseUserData : public base::SupportsUserData::Data { |
| 14 public: |
| 15 // This enum should be synced with DataUseServices enum in histograms.xml. |
| 16 // Please keep them synced after any updates. |
| 17 enum ServiceType { |
| 18 SUGGESTIONS, |
| 19 }; |
| 20 explicit DataUseUserData(ServiceType service_type); |
| 21 ~DataUseUserData() override; |
| 22 |
| 23 ServiceType service_type() const { return service_type_; } |
| 24 |
| 25 static const void* kUserDataKey; |
| 26 |
| 27 private: |
| 28 ServiceType service_type_; |
| 29 }; |
| 30 base::SupportsUserData::Data* CreateDataUseUserData( |
| 31 DataUseUserData::ServiceType service); |
| 32 |
| 33 const char* ReturnServiceName(DataUseUserData::ServiceType service); |
| 34 } // data_use_measurement namespace |
| 35 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_USER_DATA_H_ |
OLD | NEW |