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 #include "components/sync/model_impl/model_type_store_backend.h" | 5 #include "components/sync/model_impl/model_type_store_backend.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace syncer { | 25 namespace syncer { |
26 | 26 |
27 const int64_t kInvalidSchemaVersion = -1; | 27 const int64_t kInvalidSchemaVersion = -1; |
28 const int64_t ModelTypeStoreBackend::kLatestSchemaVersion = 1; | 28 const int64_t ModelTypeStoreBackend::kLatestSchemaVersion = 1; |
29 const char ModelTypeStoreBackend::kDBSchemaDescriptorRecordId[] = | 29 const char ModelTypeStoreBackend::kDBSchemaDescriptorRecordId[] = |
30 "_mts_schema_descriptor"; | 30 "_mts_schema_descriptor"; |
31 const char ModelTypeStoreBackend::kStoreInitResultHistogramName[] = | 31 const char ModelTypeStoreBackend::kStoreInitResultHistogramName[] = |
32 "Sync.ModelTypeStoreInitResult"; | 32 "Sync.ModelTypeStoreInitResult"; |
33 | 33 |
34 // static | 34 // static |
35 base::LazyInstance<ModelTypeStoreBackend::BackendMap> | 35 base::LazyInstance<ModelTypeStoreBackend::BackendMap>::DestructorAtExit |
36 ModelTypeStoreBackend::backend_map_ = LAZY_INSTANCE_INITIALIZER; | 36 ModelTypeStoreBackend::backend_map_ = LAZY_INSTANCE_INITIALIZER; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 StoreInitResultForHistogram LevelDbStatusToStoreInitResult( | 40 StoreInitResultForHistogram LevelDbStatusToStoreInitResult( |
41 const leveldb::Status& status) { | 41 const leveldb::Status& status) { |
42 if (status.ok()) | 42 if (status.ok()) |
43 return STORE_INIT_RESULT_SUCCESS; | 43 return STORE_INIT_RESULT_SUCCESS; |
44 if (status.IsNotFound()) | 44 if (status.IsNotFound()) |
45 return STORE_INIT_RESULT_NOT_FOUND; | 45 return STORE_INIT_RESULT_NOT_FOUND; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 | 258 |
259 // static | 259 // static |
260 void ModelTypeStoreBackend::RecordStoreInitResultHistogram( | 260 void ModelTypeStoreBackend::RecordStoreInitResultHistogram( |
261 StoreInitResultForHistogram result) { | 261 StoreInitResultForHistogram result) { |
262 UMA_HISTOGRAM_ENUMERATION(kStoreInitResultHistogramName, result, | 262 UMA_HISTOGRAM_ENUMERATION(kStoreInitResultHistogramName, result, |
263 STORE_INIT_RESULT_COUNT); | 263 STORE_INIT_RESULT_COUNT); |
264 } | 264 } |
265 | 265 |
266 } // namespace syncer | 266 } // namespace syncer |
OLD | NEW |