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> |
| 9 #include <stdint.h> |
| 10 |
8 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" |
9 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
10 #include "base/values.h" | 14 #include "base/values.h" |
11 #include "rlz/lib/rlz_value_store.h" | 15 #include "rlz/lib/rlz_value_store.h" |
12 | 16 |
13 namespace base { | 17 namespace base { |
14 class ListValue; | 18 class ListValue; |
15 class SequencedTaskRunner; | 19 class SequencedTaskRunner; |
16 class Value; | 20 class Value; |
17 } | 21 } |
18 | 22 |
19 namespace rlz_lib { | 23 namespace rlz_lib { |
20 | 24 |
21 // An implementation of RlzValueStore for ChromeOS. | 25 // An implementation of RlzValueStore for ChromeOS. |
22 class RlzValueStoreChromeOS : public RlzValueStore, | 26 class RlzValueStoreChromeOS : public RlzValueStore, |
23 public base::NonThreadSafe { | 27 public base::NonThreadSafe { |
24 public: | 28 public: |
25 // // Sets the task runner that will be used by ImportantFileWriter for write | 29 // // Sets the task runner that will be used by ImportantFileWriter for write |
26 // // operations. | 30 // // operations. |
27 // static void SetFileTaskRunner(base::SequencedTaskRunner* file_task_runner); | 31 // static void SetFileTaskRunner(base::SequencedTaskRunner* file_task_runner); |
28 | 32 |
29 // Creates new instance and synchronously reads data from file. | 33 // Creates new instance and synchronously reads data from file. |
30 RlzValueStoreChromeOS(const base::FilePath& store_path); | 34 RlzValueStoreChromeOS(const base::FilePath& store_path); |
31 ~RlzValueStoreChromeOS() override; | 35 ~RlzValueStoreChromeOS() override; |
32 | 36 |
33 // RlzValueStore overrides: | 37 // RlzValueStore overrides: |
34 bool HasAccess(AccessType type) override; | 38 bool HasAccess(AccessType type) override; |
35 | 39 |
36 bool WritePingTime(Product product, int64 time) override; | 40 bool WritePingTime(Product product, int64_t time) override; |
37 bool ReadPingTime(Product product, int64* time) override; | 41 bool ReadPingTime(Product product, int64_t* time) override; |
38 bool ClearPingTime(Product product) override; | 42 bool ClearPingTime(Product product) override; |
39 | 43 |
40 bool WriteAccessPointRlz(AccessPoint access_point, | 44 bool WriteAccessPointRlz(AccessPoint access_point, |
41 const char* new_rlz) override; | 45 const char* new_rlz) override; |
42 bool ReadAccessPointRlz(AccessPoint access_point, | 46 bool ReadAccessPointRlz(AccessPoint access_point, |
43 char* rlz, | 47 char* rlz, |
44 size_t rlz_size) override; | 48 size_t rlz_size) override; |
45 bool ClearAccessPointRlz(AccessPoint access_point) override; | 49 bool ClearAccessPointRlz(AccessPoint access_point) override; |
46 | 50 |
47 bool AddProductEvent(Product product, const char* event_rlz) override; | 51 bool AddProductEvent(Product product, const char* event_rlz) override; |
(...skipping 27 matching lines...) Expand all Loading... |
75 base::FilePath store_path_; | 79 base::FilePath store_path_; |
76 | 80 |
77 bool read_only_; | 81 bool read_only_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); | 83 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace rlz_lib | 86 } // namespace rlz_lib |
83 | 87 |
84 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ | 88 #endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_ |
OLD | NEW |