| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void CollectGarbage() override; | 63 void CollectGarbage() override; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 // Reads RLZ store from file. | 66 // Reads RLZ store from file. |
| 67 void ReadStore(); | 67 void ReadStore(); |
| 68 | 68 |
| 69 // Writes RLZ store back to file. | 69 // Writes RLZ store back to file. |
| 70 void WriteStore(); | 70 void WriteStore(); |
| 71 | 71 |
| 72 // Adds |value| to list at |list_name| path in JSON store. | 72 // Adds |value| to list at |list_name| path in JSON store. |
| 73 bool AddValueToList(const std::string& list_name, base::Value* value); | 73 bool AddValueToList(const std::string& list_name, |
| 74 std::unique_ptr<base::Value> value); |
| 74 // Removes |value| from list at |list_name| path in JSON store. | 75 // Removes |value| from list at |list_name| path in JSON store. |
| 75 bool RemoveValueFromList(const std::string& list_name, | 76 bool RemoveValueFromList(const std::string& list_name, |
| 76 const base::Value& value); | 77 const base::Value& value); |
| 77 | 78 |
| 78 // In-memory store with RLZ data. | 79 // In-memory store with RLZ data. |
| 79 std::unique_ptr<base::DictionaryValue> rlz_store_; | 80 std::unique_ptr<base::DictionaryValue> rlz_store_; |
| 80 | 81 |
| 81 base::FilePath store_path_; | 82 base::FilePath store_path_; |
| 82 | 83 |
| 83 bool read_only_; | 84 bool read_only_; |
| 84 | 85 |
| 85 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); | 86 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace rlz_lib | 89 } // namespace rlz_lib |
| 89 | 90 |
| 90 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 91 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
| OLD | NEW |