Chromium Code Reviews| 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 #include "components/data_use_measurement/content/data_use_user_data.h" | |
| 6 | |
| 7 namespace data_use_measurement { | |
| 8 DataUseUserData::DataUseUserData(ServiceType service_type) | |
| 9 : service_type_(service_type) {} | |
| 10 | |
| 11 DataUseUserData::~DataUseUserData() {} | |
| 12 | |
| 13 // static | |
| 14 const void* DataUseUserData::kUserDataKey = | |
| 15 static_cast<const void*>(&DataUseUserData::kUserDataKey); | |
| 16 | |
| 17 // Helper function to create DataUseUserData. | |
| 18 base::SupportsUserData::Data* CreateDataUseUserData( | |
| 19 DataUseUserData::ServiceType service_type) { | |
| 20 return new DataUseUserData(service_type); | |
| 21 } | |
| 22 | |
| 23 const char* ReturnServiceName(DataUseUserData::ServiceType service_type) { | |
| 24 switch (service_type) { | |
| 25 case DataUseUserData::SUGGESTIONS: | |
| 26 return "Suggestions"; | |
| 27 default: | |
| 28 break; | |
|
sclittle
2015/08/24 23:59:34
nit: Just put the NOTREACHED here under "default".
amohammadkhan
2015/08/25 00:12:07
Done.
| |
| 29 } | |
| 30 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.
| |
| 31 return "INVALID"; | |
| 32 } | |
| 33 | |
| 34 } // data_use_measurement namespace | |
| OLD | NEW |