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 "components/sync/syncable/on_disk_directory_backing_store.h" | 5 #include "components/sync/syncable/on_disk_directory_backing_store.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "components/sync/syncable/syncable-inl.h" | 10 #include "components/sync/syncable/syncable-inl.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (result == OPENED) { | 70 if (result == OPENED) { |
71 UMA_HISTOGRAM_ENUMERATION("Sync.DirectoryOpenResult", FIRST_TRY_SUCCESS, | 71 UMA_HISTOGRAM_ENUMERATION("Sync.DirectoryOpenResult", FIRST_TRY_SUCCESS, |
72 RESULT_COUNT); | 72 RESULT_COUNT); |
73 return OPENED; | 73 return OPENED; |
74 } | 74 } |
75 | 75 |
76 ReportFirstTryOpenFailure(); | 76 ReportFirstTryOpenFailure(); |
77 | 77 |
78 // The fallback: delete the current database and return a fresh one. We can | 78 // The fallback: delete the current database and return a fresh one. We can |
79 // fetch the user's data from the cloud. | 79 // fetch the user's data from the cloud. |
80 STLDeleteValues(handles_map); | 80 base::STLDeleteValues(handles_map); |
81 STLDeleteElements(delete_journals); | 81 base::STLDeleteElements(delete_journals); |
82 | 82 |
83 ResetAndCreateConnection(); | 83 ResetAndCreateConnection(); |
84 | 84 |
85 base::DeleteFile(backing_file_path_, false); | 85 base::DeleteFile(backing_file_path_, false); |
86 | 86 |
87 result = TryLoad(handles_map, delete_journals, metahandles_to_purge, | 87 result = TryLoad(handles_map, delete_journals, metahandles_to_purge, |
88 kernel_load_info); | 88 kernel_load_info); |
89 if (result == OPENED) { | 89 if (result == OPENED) { |
90 UMA_HISTOGRAM_ENUMERATION("Sync.DirectoryOpenResult", SECOND_TRY_SUCCESS, | 90 UMA_HISTOGRAM_ENUMERATION("Sync.DirectoryOpenResult", SECOND_TRY_SUCCESS, |
91 RESULT_COUNT); | 91 RESULT_COUNT); |
(...skipping 17 matching lines...) Expand all Loading... |
109 NOTREACHED() << "Crashing to preserve corrupt sync database"; | 109 NOTREACHED() << "Crashing to preserve corrupt sync database"; |
110 } | 110 } |
111 | 111 |
112 const base::FilePath& OnDiskDirectoryBackingStore::backing_file_path() const { | 112 const base::FilePath& OnDiskDirectoryBackingStore::backing_file_path() const { |
113 DCHECK(CalledOnValidThread()); | 113 DCHECK(CalledOnValidThread()); |
114 return backing_file_path_; | 114 return backing_file_path_; |
115 } | 115 } |
116 | 116 |
117 } // namespace syncable | 117 } // namespace syncable |
118 } // namespace syncer | 118 } // namespace syncer |
OLD | NEW |