OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ |
6 #define COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ | 6 #define COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 std::unique_ptr<leveldb::Env> env_; | 144 std::unique_ptr<leveldb::Env> env_; |
145 | 145 |
146 std::unique_ptr<leveldb::DB> db_; | 146 std::unique_ptr<leveldb::DB> db_; |
147 | 147 |
148 std::string path_; | 148 std::string path_; |
149 | 149 |
150 // backend_map_ holds raw pointer of backend, and when stores ask for backend, | 150 // backend_map_ holds raw pointer of backend, and when stores ask for backend, |
151 // GetOrCreateBackend will return scoped_refptr of backend. backend_map_ | 151 // GetOrCreateBackend will return scoped_refptr of backend. backend_map_ |
152 // doesn't take reference to backend, therefore doesn't block backend | 152 // doesn't take reference to backend, therefore doesn't block backend |
153 // destruction. | 153 // destruction. |
154 static base::LazyInstance<BackendMap> backend_map_; | 154 static base::LazyInstance<BackendMap>::DestructorAtExit backend_map_; |
155 | 155 |
156 // Macro wrapped mutex to guard against concurrent calls in debug builds. | 156 // Macro wrapped mutex to guard against concurrent calls in debug builds. |
157 DFAKE_MUTEX(push_pop_); | 157 DFAKE_MUTEX(push_pop_); |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(ModelTypeStoreBackend); | 159 DISALLOW_COPY_AND_ASSIGN(ModelTypeStoreBackend); |
160 }; | 160 }; |
161 | 161 |
162 } // namespace syncer | 162 } // namespace syncer |
163 | 163 |
164 #endif // COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ | 164 #endif // COMPONENTS_SYNC_MODEL_IMPL_MODEL_TYPE_STORE_BACKEND_H_ |
OLD | NEW |