| 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/sequence_checker.h" |
| 16 #include "rlz/lib/rlz_value_store.h" | 16 #include "rlz/lib/rlz_value_store.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class Value; | 20 class Value; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace rlz_lib { | 23 namespace rlz_lib { |
| 24 | 24 |
| 25 // An implementation of RlzValueStore for ChromeOS. | 25 // An implementation of RlzValueStore for ChromeOS. |
| 26 class RlzValueStoreChromeOS : public RlzValueStore, | 26 class RlzValueStoreChromeOS : public RlzValueStore { |
| 27 public base::NonThreadSafe { | |
| 28 public: | 27 public: |
| 29 // Creates new instance and synchronously reads data from file. | 28 // Creates new instance and synchronously reads data from file. |
| 30 explicit RlzValueStoreChromeOS(const base::FilePath& store_path); | 29 explicit RlzValueStoreChromeOS(const base::FilePath& store_path); |
| 31 ~RlzValueStoreChromeOS() override; | 30 ~RlzValueStoreChromeOS() override; |
| 32 | 31 |
| 33 // RlzValueStore overrides: | 32 // RlzValueStore overrides: |
| 34 bool HasAccess(AccessType type) override; | 33 bool HasAccess(AccessType type) override; |
| 35 | 34 |
| 36 bool WritePingTime(Product product, int64_t time) override; | 35 bool WritePingTime(Product product, int64_t time) override; |
| 37 bool ReadPingTime(Product product, int64_t* time) override; | 36 bool ReadPingTime(Product product, int64_t* time) override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool RemoveValueFromList(const std::string& list_name, | 69 bool RemoveValueFromList(const std::string& list_name, |
| 71 const base::Value& value); | 70 const base::Value& value); |
| 72 | 71 |
| 73 // In-memory store with RLZ data. | 72 // In-memory store with RLZ data. |
| 74 std::unique_ptr<base::DictionaryValue> rlz_store_; | 73 std::unique_ptr<base::DictionaryValue> rlz_store_; |
| 75 | 74 |
| 76 base::FilePath store_path_; | 75 base::FilePath store_path_; |
| 77 | 76 |
| 78 bool read_only_; | 77 bool read_only_; |
| 79 | 78 |
| 79 SEQUENCE_CHECKER(sequence_checker_); |
| 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); | 81 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace rlz_lib | 84 } // namespace rlz_lib |
| 84 | 85 |
| 85 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 86 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
| OLD | NEW |