| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ |
| 6 #define COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Records the DateLastRollCall for the specified |ids|. |datenum| must be a | 46 // Records the DateLastRollCall for the specified |ids|. |datenum| must be a |
| 47 // non-negative integer: calls with a negative |datenum| are simply ignored. | 47 // non-negative integer: calls with a negative |datenum| are simply ignored. |
| 48 // Calls to SetDateLastRollCall that occur prior to the persisted data store | 48 // Calls to SetDateLastRollCall that occur prior to the persisted data store |
| 49 // has been fully initialized are ignored. Also sets the PingFreshness. | 49 // has been fully initialized are ignored. Also sets the PingFreshness. |
| 50 void SetDateLastRollCall(const std::vector<std::string>& ids, int datenum); | 50 void SetDateLastRollCall(const std::vector<std::string>& ids, int datenum); |
| 51 | 51 |
| 52 // This is called only via update_client's RegisterUpdateClientPreferences. | 52 // This is called only via update_client's RegisterUpdateClientPreferences. |
| 53 static void RegisterPrefs(PrefRegistrySimple* registry); | 53 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 54 | 54 |
| 55 // These functions return cohort data for the specified |id|. "Cohort" |
| 56 // indicates the membership of the client in any release channels components |
| 57 // have set up in a machine-readable format, while "CohortName" does so in a |
| 58 // human-readable form. "CohortHint" indicates the client's channel selection |
| 59 // preference. |
| 60 std::string GetCohort(const std::string& id) const; |
| 61 std::string GetCohortHint(const std::string& id) const; |
| 62 std::string GetCohortName(const std::string& id) const; |
| 63 |
| 64 // These functions set cohort data for the specified |id|. |
| 65 void SetCohort(const std::string& id, const std::string& cohort); |
| 66 void SetCohortHint(const std::string& id, const std::string& cohort_hint); |
| 67 void SetCohortName(const std::string& id, const std::string& cohort_name); |
| 68 |
| 55 private: | 69 private: |
| 70 int GetInt(const std::string& id, const std::string& key, int fallback) const; |
| 71 std::string GetString(const std::string& id, const std::string& key) const; |
| 72 void SetString(const std::string& id, |
| 73 const std::string& key, |
| 74 const std::string& value); |
| 75 |
| 56 base::ThreadChecker thread_checker_; | 76 base::ThreadChecker thread_checker_; |
| 57 PrefService* pref_service_; | 77 PrefService* pref_service_; |
| 58 | 78 |
| 59 DISALLOW_COPY_AND_ASSIGN(PersistedData); | 79 DISALLOW_COPY_AND_ASSIGN(PersistedData); |
| 60 }; | 80 }; |
| 61 | 81 |
| 62 } // namespace update_client | 82 } // namespace update_client |
| 63 | 83 |
| 64 #endif // COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ | 84 #endif // COMPONENTS_UPDATE_CLIENT_PERSISTED_DATA_H_ |
| OLD | NEW |