Chromium Code Reviews| Index: components/data_use_measurement/core/data_use_user_data.h |
| diff --git a/components/data_use_measurement/core/data_use_user_data.h b/components/data_use_measurement/core/data_use_user_data.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..37393fd1fc57024bf200e1fa1c6dd84ed2f5ca01 |
| --- /dev/null |
| +++ b/components/data_use_measurement/core/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_CORE_DATA_USE_USER_DATA_H_ |
| +#define COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_USER_DATA_H_ |
| + |
| +#include "base/supports_user_data.h" |
| + |
| +namespace data_use_measurement { |
|
sclittle
2015/08/26 23:08:30
nit: add blank line after
amohammadkhan
2015/08/29 01:00:59
Done.
|
| +// 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( |
|
sclittle
2015/08/26 23:08:30
nit: separate from class with a blank line
sclittle
2015/08/26 23:08:30
Also, specify in a comment for this function that
amohammadkhan
2015/08/29 01:00:59
Done.
amohammadkhan
2015/08/29 01:00:59
Done.
|
| + DataUseUserData::ServiceType service); |
| + |
| +const char* ReturnServiceName(DataUseUserData::ServiceType service); |
|
sclittle
2015/08/26 23:08:30
nit: name seems weird, maybe "GetServiceName" inst
amohammadkhan
2015/08/29 01:00:59
Done.
|
| +} // data_use_measurement namespace |
|
sclittle
2015/08/26 23:08:30
nit: add blank line before
amohammadkhan
2015/08/29 01:00:59
Done.
|
| +#endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_DATA_USE_USER_DATA_H_ |