| 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/directory.h" | 5 #include "sync/syncable/directory.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/perftimer.h" | 8 #include "base/perftimer.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 11 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
| 12 #include "sync/syncable/base_transaction.h" | 12 #include "sync/syncable/base_transaction.h" |
| 13 #include "sync/syncable/entry.h" | 13 #include "sync/syncable/entry.h" |
| 14 #include "sync/syncable/entry_kernel.h" | 14 #include "sync/syncable/entry_kernel.h" |
| 15 #include "sync/syncable/in_memory_directory_backing_store.h" | 15 #include "sync/syncable/in_memory_directory_backing_store.h" |
| 16 #include "sync/syncable/on_disk_directory_backing_store.h" | 16 #include "sync/syncable/on_disk_directory_backing_store.h" |
| 17 #include "sync/syncable/read_transaction.h" | 17 #include "sync/syncable/read_transaction.h" |
| 18 #include "sync/syncable/scoped_index_updater.h" | 18 #include "sync/syncable/scoped_index_updater.h" |
| 19 #include "sync/syncable/syncable-inl.h" | 19 #include "sync/syncable/syncable-inl.h" |
| 20 #include "sync/syncable/syncable_changes_version.h" | 20 #include "sync/syncable/syncable_changes_version.h" |
| 21 #include "sync/syncable/syncable_util.h" | 21 #include "sync/syncable/syncable_util.h" |
| 22 #include "sync/syncable/write_transaction.h" | 22 #include "sync/syncable/write_transaction.h" |
| 23 | 23 |
| 24 using syncer::Encryptor; | |
| 25 using syncer::ReportUnrecoverableErrorFunction; | |
| 26 using syncer::UnrecoverableErrorHandler; | |
| 27 using std::string; | 24 using std::string; |
| 28 | 25 |
| 26 namespace syncer { |
| 29 namespace syncable { | 27 namespace syncable { |
| 30 | 28 |
| 31 namespace { | 29 namespace { |
| 32 // Max number of milliseconds to spend checking syncable entry invariants | 30 // Max number of milliseconds to spend checking syncable entry invariants |
| 33 const int kInvariantCheckMaxMs = 50; | 31 const int kInvariantCheckMaxMs = 50; |
| 34 | 32 |
| 35 // Helper function to add an item to the index, if it ought to be added. | 33 // Helper function to add an item to the index, if it ought to be added. |
| 36 template<typename Indexer> | 34 template<typename Indexer> |
| 37 void InitializeIndexEntry(EntryKernel* entry, | 35 void InitializeIndexEntry(EntryKernel* entry, |
| 38 typename Index<Indexer>::Set* index) { | 36 typename Index<Indexer>::Set* index) { |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 } | 1309 } |
| 1312 } | 1310 } |
| 1313 // There were no children in the linked list. | 1311 // There were no children in the linked list. |
| 1314 return NULL; | 1312 return NULL; |
| 1315 } | 1313 } |
| 1316 | 1314 |
| 1317 ScopedKernelLock::ScopedKernelLock(const Directory* dir) | 1315 ScopedKernelLock::ScopedKernelLock(const Directory* dir) |
| 1318 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { | 1316 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { |
| 1319 } | 1317 } |
| 1320 | 1318 |
| 1321 } | 1319 } // namespace syncable |
| 1320 } // namespace syncer |
| OLD | NEW |