| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 // static | 63 // static |
| 64 bool ParentIdAndHandleIndexer::ShouldInclude(const EntryKernel* a) { | 64 bool ParentIdAndHandleIndexer::ShouldInclude(const EntryKernel* a) { |
| 65 // This index excludes deleted items and the root item. The root | 65 // This index excludes deleted items and the root item. The root |
| 66 // item is excluded so that it doesn't show up as a child of itself. | 66 // item is excluded so that it doesn't show up as a child of itself. |
| 67 return !a->ref(IS_DEL) && !a->ref(ID).IsRoot(); | 67 return !a->ref(IS_DEL) && !a->ref(ID).IsRoot(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // static | 70 // static |
| 71 const FilePath::CharType Directory::kSyncDatabaseFilename[] = | 71 const base::FilePath::CharType Directory::kSyncDatabaseFilename[] = |
| 72 FILE_PATH_LITERAL("SyncData.sqlite3"); | 72 FILE_PATH_LITERAL("SyncData.sqlite3"); |
| 73 | 73 |
| 74 void Directory::InitKernelForTest( | 74 void Directory::InitKernelForTest( |
| 75 const std::string& name, | 75 const std::string& name, |
| 76 DirectoryChangeDelegate* delegate, | 76 DirectoryChangeDelegate* delegate, |
| 77 const WeakHandle<TransactionObserver>& transaction_observer) { | 77 const WeakHandle<TransactionObserver>& transaction_observer) { |
| 78 DCHECK(!kernel_); | 78 DCHECK(!kernel_); |
| 79 kernel_ = new Kernel(name, KernelLoadInfo(), delegate, transaction_observer); | 79 kernel_ = new Kernel(name, KernelLoadInfo(), delegate, transaction_observer); |
| 80 } | 80 } |
| 81 | 81 |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 // There were no children in the linked list. | 1285 // There were no children in the linked list. |
| 1286 return NULL; | 1286 return NULL; |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 ScopedKernelLock::ScopedKernelLock(const Directory* dir) | 1289 ScopedKernelLock::ScopedKernelLock(const Directory* dir) |
| 1290 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { | 1290 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 } // namespace syncable | 1293 } // namespace syncable |
| 1294 } // namespace syncer | 1294 } // namespace syncer |
| OLD | NEW |