| 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_VALUE_STORE_H_ | 5 #ifndef RLZ_VALUE_STORE_H_ |
| 6 #define RLZ_VALUE_STORE_H_ | 6 #define RLZ_VALUE_STORE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "rlz/lib/rlz_enums.h" | 10 #include "rlz/lib/rlz_enums.h" |
| 11 | 11 |
| 12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 13 #include "rlz/win/lib/lib_mutex.h" | 13 #include "rlz/win/lib/lib_mutex.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
| 17 #include "base/mac/scoped_nsautorelease_pool.h" | 17 #include "base/mac/scoped_nsautorelease_pool.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 | 20 |
| 21 #include <string> | 21 #include <string> |
| 22 #include <vector> | 22 #include <vector> |
| 23 | 23 |
| 24 namespace base { |
| 24 class FilePath; | 25 class FilePath; |
| 26 } |
| 25 | 27 |
| 26 namespace rlz_lib { | 28 namespace rlz_lib { |
| 27 | 29 |
| 28 // Abstracts away rlz's key value store. On windows, this usually writes to | 30 // Abstracts away rlz's key value store. On windows, this usually writes to |
| 29 // the registry. On mac, it writes to an NSDefaults object. | 31 // the registry. On mac, it writes to an NSDefaults object. |
| 30 class RlzValueStore { | 32 class RlzValueStore { |
| 31 public: | 33 public: |
| 32 virtual ~RlzValueStore() {} | 34 virtual ~RlzValueStore() {} |
| 33 | 35 |
| 34 enum AccessType { kReadAccess, kWriteAccess }; | 36 enum AccessType { kReadAccess, kWriteAccess }; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 100 LibMutex lock_; | 102 LibMutex lock_; |
| 101 #elif defined(OS_MACOSX) | 103 #elif defined(OS_MACOSX) |
| 102 base::mac::ScopedNSAutoreleasePool autorelease_pool_; | 104 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
| 103 #endif | 105 #endif |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 #if defined(OS_POSIX) | 108 #if defined(OS_POSIX) |
| 107 namespace testing { | 109 namespace testing { |
| 108 // Prefix |directory| to the path where the RLZ data file lives, for tests. | 110 // Prefix |directory| to the path where the RLZ data file lives, for tests. |
| 109 void SetRlzStoreDirectory(const FilePath& directory); | 111 void SetRlzStoreDirectory(const base::FilePath& directory); |
| 110 | 112 |
| 111 // Returns the path of the file used as data store. | 113 // Returns the path of the file used as data store. |
| 112 std::string RlzStoreFilenameStr(); | 114 std::string RlzStoreFilenameStr(); |
| 113 } // namespace testing | 115 } // namespace testing |
| 114 #endif // defined(OS_POSIX) | 116 #endif // defined(OS_POSIX) |
| 115 | 117 |
| 116 } // namespace rlz_lib | 118 } // namespace rlz_lib |
| 117 | 119 |
| 118 #endif // RLZ_VALUE_STORE_H_ | 120 #endif // RLZ_VALUE_STORE_H_ |
| OLD | NEW |