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 #include "sync/syncable/on_disk_directory_backing_store.h" | 5 #include "sync/syncable/on_disk_directory_backing_store.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "sync/syncable/syncable-inl.h" | 10 #include "sync/syncable/syncable-inl.h" |
11 | 11 |
12 namespace syncer { | 12 namespace syncer { |
13 namespace syncable { | 13 namespace syncable { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 enum HistogramResultEnum { | 17 enum HistogramResultEnum { |
18 FIRST_TRY_SUCCESS, | 18 FIRST_TRY_SUCCESS, |
19 SECOND_TRY_SUCCESS, | 19 SECOND_TRY_SUCCESS, |
20 SECOND_TRY_FAILURE, | 20 SECOND_TRY_FAILURE, |
21 RESULT_COUNT | 21 RESULT_COUNT |
22 }; | 22 }; |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 OnDiskDirectoryBackingStore::OnDiskDirectoryBackingStore( | 26 OnDiskDirectoryBackingStore::OnDiskDirectoryBackingStore( |
27 const std::string& dir_name, const FilePath& backing_filepath) | 27 const std::string& dir_name, const base::FilePath& backing_filepath) |
28 : DirectoryBackingStore(dir_name), | 28 : DirectoryBackingStore(dir_name), |
29 allow_failure_for_test_(false), | 29 allow_failure_for_test_(false), |
30 backing_filepath_(backing_filepath) { | 30 backing_filepath_(backing_filepath) { |
31 db_->set_exclusive_locking(); | 31 db_->set_exclusive_locking(); |
32 db_->set_page_size(4096); | 32 db_->set_page_size(4096); |
33 } | 33 } |
34 | 34 |
35 OnDiskDirectoryBackingStore::~OnDiskDirectoryBackingStore() { } | 35 OnDiskDirectoryBackingStore::~OnDiskDirectoryBackingStore() { } |
36 | 36 |
37 DirOpenResult OnDiskDirectoryBackingStore::TryLoad( | 37 DirOpenResult OnDiskDirectoryBackingStore::TryLoad( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // immediately so a developer can investigate. | 102 // immediately so a developer can investigate. |
103 // | 103 // |
104 // Developers: If you're not interested in debugging this right now, just move | 104 // Developers: If you're not interested in debugging this right now, just move |
105 // aside the 'Sync Data' directory in your profile. This is similar to what | 105 // aside the 'Sync Data' directory in your profile. This is similar to what |
106 // the code would do if this DCHECK were disabled. | 106 // the code would do if this DCHECK were disabled. |
107 NOTREACHED() << "Crashing to preserve corrupt sync database"; | 107 NOTREACHED() << "Crashing to preserve corrupt sync database"; |
108 } | 108 } |
109 | 109 |
110 } // namespace syncable | 110 } // namespace syncable |
111 } // namespace syncer | 111 } // namespace syncer |
OLD | NEW |