| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 5 #ifndef RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
| 6 #define RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 6 #define RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void CollectGarbage() override; | 57 void CollectGarbage() override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Reads RLZ store from file. | 60 // Reads RLZ store from file. |
| 61 void ReadStore(); | 61 void ReadStore(); |
| 62 | 62 |
| 63 // Writes RLZ store back to file. | 63 // Writes RLZ store back to file. |
| 64 void WriteStore(); | 64 void WriteStore(); |
| 65 | 65 |
| 66 // Adds |value| to list at |list_name| path in JSON store. | 66 // Adds |value| to list at |list_name| path in JSON store. |
| 67 bool AddValueToList(std::string list_name, base::Value* value); | 67 bool AddValueToList(const std::string& list_name, base::Value* value); |
| 68 // Removes |value| from list at |list_name| path in JSON store. | 68 // Removes |value| from list at |list_name| path in JSON store. |
| 69 bool RemoveValueFromList(std::string list_name, const base::Value& value); | 69 bool RemoveValueFromList(const std::string& list_name, |
| 70 const base::Value& value); |
| 70 | 71 |
| 71 // In-memory store with RLZ data. | 72 // In-memory store with RLZ data. |
| 72 scoped_ptr<base::DictionaryValue> rlz_store_; | 73 scoped_ptr<base::DictionaryValue> rlz_store_; |
| 73 | 74 |
| 74 base::FilePath store_path_; | 75 base::FilePath store_path_; |
| 75 | 76 |
| 76 bool read_only_; | 77 bool read_only_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); | 79 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace rlz_lib | 82 } // namespace rlz_lib |
| 82 | 83 |
| 83 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 84 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
| OLD | NEW |