| 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" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // Returns a RlzValueStore protected by a cross-process lock, or NULL if the | 92 // Returns a RlzValueStore protected by a cross-process lock, or NULL if the |
| 93 // lock can't be obtained. The lifetime of the returned object is limited to | 93 // lock can't be obtained. The lifetime of the returned object is limited to |
| 94 // the lifetime of this ScopedRlzValueStoreLock object. | 94 // the lifetime of this ScopedRlzValueStoreLock object. |
| 95 RlzValueStore* GetStore(); | 95 RlzValueStore* GetStore(); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 scoped_ptr<RlzValueStore> store_; | 98 scoped_ptr<RlzValueStore> store_; |
| 99 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
| 100 LibMutex lock_; | 100 LibMutex lock_; |
| 101 #else | 101 #elif defined(OS_MACOSX) |
| 102 base::mac::ScopedNSAutoreleasePool autorelease_pool_; | 102 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
| 103 #endif | 103 #endif |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) |
| 107 namespace testing { | 107 namespace testing { |
| 108 // Prefix |directory| to the path where the RLZ data file lives, for tests. | 108 // Prefix |directory| to the path where the RLZ data file lives, for tests. |
| 109 void SetRlzStoreDirectory(const FilePath& directory); | 109 void SetRlzStoreDirectory(const FilePath& directory); |
| 110 | 110 |
| 111 // Returns the path of the plist file used as data store. | 111 // Returns the path of the plist file used as data store. |
| 112 std::string RlzPlistFilenameStr(); | 112 std::string RlzPlistFilenameStr(); |
| 113 } // namespace testing | 113 } // namespace testing |
| 114 #endif // defined(OS_MACOSX) | 114 #endif // defined(OS_MACOSX) |
| 115 | 115 |
| 116 | 116 |
| 117 } // namespace rlz_lib | 117 } // namespace rlz_lib |
| 118 | 118 |
| 119 #endif // RLZ_VALUE_STORE_H_ | 119 #endif // RLZ_VALUE_STORE_H_ |
| OLD | NEW |