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_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ | 5 #ifndef RLZ_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ |
6 #define RLZ_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ | 6 #define RLZ_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "rlz/lib/rlz_value_store.h" | 10 #include "rlz/lib/rlz_value_store.h" |
11 | 11 |
12 @class NSDictionary; | 12 @class NSDictionary; |
13 @class NSMutableDictionary; | 13 @class NSMutableDictionary; |
14 | 14 |
15 namespace rlz_lib { | 15 namespace rlz_lib { |
16 | 16 |
17 // An implementation of RlzValueStore for mac. It stores information in a | 17 // An implementation of RlzValueStore for mac. It stores information in a |
18 // plist file in the user's Application Support folder. | 18 // plist file in the user's Application Support folder. |
19 class RlzValueStoreMac : public RlzValueStore { | 19 class RlzValueStoreMac : public RlzValueStore { |
20 public: | 20 public: |
21 virtual bool HasAccess(AccessType type) OVERRIDE; | 21 virtual bool HasAccess(AccessType type) override; |
22 | 22 |
23 virtual bool WritePingTime(Product product, int64 time) OVERRIDE; | 23 virtual bool WritePingTime(Product product, int64 time) override; |
24 virtual bool ReadPingTime(Product product, int64* time) OVERRIDE; | 24 virtual bool ReadPingTime(Product product, int64* time) override; |
25 virtual bool ClearPingTime(Product product) OVERRIDE; | 25 virtual bool ClearPingTime(Product product) override; |
26 | 26 |
27 virtual bool WriteAccessPointRlz(AccessPoint access_point, | 27 virtual bool WriteAccessPointRlz(AccessPoint access_point, |
28 const char* new_rlz) OVERRIDE; | 28 const char* new_rlz) override; |
29 virtual bool ReadAccessPointRlz(AccessPoint access_point, | 29 virtual bool ReadAccessPointRlz(AccessPoint access_point, |
30 char* rlz, | 30 char* rlz, |
31 size_t rlz_size) OVERRIDE; | 31 size_t rlz_size) override; |
32 virtual bool ClearAccessPointRlz(AccessPoint access_point) OVERRIDE; | 32 virtual bool ClearAccessPointRlz(AccessPoint access_point) override; |
33 | 33 |
34 virtual bool AddProductEvent(Product product, const char* event_rlz) OVERRIDE; | 34 virtual bool AddProductEvent(Product product, const char* event_rlz) override; |
35 virtual bool ReadProductEvents(Product product, | 35 virtual bool ReadProductEvents(Product product, |
36 std::vector<std::string>* events) OVERRIDE; | 36 std::vector<std::string>* events) override; |
37 virtual bool ClearProductEvent(Product product, | 37 virtual bool ClearProductEvent(Product product, |
38 const char* event_rlz) OVERRIDE; | 38 const char* event_rlz) override; |
39 virtual bool ClearAllProductEvents(Product product) OVERRIDE; | 39 virtual bool ClearAllProductEvents(Product product) override; |
40 | 40 |
41 virtual bool AddStatefulEvent(Product product, | 41 virtual bool AddStatefulEvent(Product product, |
42 const char* event_rlz) OVERRIDE; | 42 const char* event_rlz) override; |
43 virtual bool IsStatefulEvent(Product product, | 43 virtual bool IsStatefulEvent(Product product, |
44 const char* event_rlz) OVERRIDE; | 44 const char* event_rlz) override; |
45 virtual bool ClearAllStatefulEvents(Product product) OVERRIDE; | 45 virtual bool ClearAllStatefulEvents(Product product) override; |
46 | 46 |
47 virtual void CollectGarbage() OVERRIDE; | 47 virtual void CollectGarbage() override; |
48 | 48 |
49 private: | 49 private: |
50 // |dict| is the dictionary that backs all data. plist_path is the name of the | 50 // |dict| is the dictionary that backs all data. plist_path is the name of the |
51 // plist file, used solely for implementing HasAccess(). | 51 // plist file, used solely for implementing HasAccess(). |
52 RlzValueStoreMac(NSMutableDictionary* dict, NSString* plist_path); | 52 RlzValueStoreMac(NSMutableDictionary* dict, NSString* plist_path); |
53 virtual ~RlzValueStoreMac(); | 53 virtual ~RlzValueStoreMac(); |
54 friend class ScopedRlzValueStoreLock; | 54 friend class ScopedRlzValueStoreLock; |
55 | 55 |
56 // Returns the backing dictionary that should be written to disk. | 56 // Returns the backing dictionary that should be written to disk. |
57 NSDictionary* dictionary(); | 57 NSDictionary* dictionary(); |
(...skipping 13 matching lines...) Expand all Loading... |
71 | 71 |
72 base::scoped_nsobject<NSMutableDictionary> dict_; | 72 base::scoped_nsobject<NSMutableDictionary> dict_; |
73 base::scoped_nsobject<NSString> plist_path_; | 73 base::scoped_nsobject<NSString> plist_path_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreMac); | 75 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreMac); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace rlz_lib | 78 } // namespace rlz_lib |
79 | 79 |
80 #endif // RLZ_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ | 80 #endif // RLZ_MAC_LIB_RLZ_VALUE_STORE_MAC_H_ |
OLD | NEW |