Chromium Code Reviews| 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" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, | 141 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, |
| 142 NigoriHandler* nigori_handler, | 142 NigoriHandler* nigori_handler, |
| 143 Cryptographer* cryptographer) | 143 Cryptographer* cryptographer) |
| 144 : kernel_(NULL), | 144 : kernel_(NULL), |
| 145 store_(store), | 145 store_(store), |
| 146 unrecoverable_error_handler_(unrecoverable_error_handler), | 146 unrecoverable_error_handler_(unrecoverable_error_handler), |
| 147 report_unrecoverable_error_function_( | 147 report_unrecoverable_error_function_( |
| 148 report_unrecoverable_error_function), | 148 report_unrecoverable_error_function), |
| 149 unrecoverable_error_set_(false), | 149 unrecoverable_error_set_(false), |
| 150 nigori_handler_(nigori_handler), | 150 nigori_handler_(nigori_handler), |
| 151 cryptographer_(cryptographer), | 151 cryptographer_(cryptographer) { |
|
rlarocque
2012/09/19 20:15:33
This change doesn't belong in this patch.
| |
| 152 invariant_check_level_(VERIFY_CHANGES) { | 152 //Perform full invariant checking for tests and the debug build. |
| 153 if(DCHECK_IS_ON()) | |
| 154 invariant_check_level_ = FULL_DB_VERIFICATION; | |
| 155 else | |
| 156 invariant_check_level_ = VERIFY_CHANGES; | |
| 153 } | 157 } |
| 154 | 158 |
| 155 Directory::~Directory() { | 159 Directory::~Directory() { |
| 156 Close(); | 160 Close(); |
| 157 } | 161 } |
| 158 | 162 |
| 159 DirOpenResult Directory::Open( | 163 DirOpenResult Directory::Open( |
| 160 const string& name, | 164 const string& name, |
| 161 DirectoryChangeDelegate* delegate, | 165 DirectoryChangeDelegate* delegate, |
| 162 const WeakHandle<TransactionObserver>& transaction_observer) { | 166 const WeakHandle<TransactionObserver>& transaction_observer) { |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 // There were no children in the linked list. | 1238 // There were no children in the linked list. |
| 1235 return NULL; | 1239 return NULL; |
| 1236 } | 1240 } |
| 1237 | 1241 |
| 1238 ScopedKernelLock::ScopedKernelLock(const Directory* dir) | 1242 ScopedKernelLock::ScopedKernelLock(const Directory* dir) |
| 1239 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { | 1243 : scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) { |
| 1240 } | 1244 } |
| 1241 | 1245 |
| 1242 } // namespace syncable | 1246 } // namespace syncable |
| 1243 } // namespace syncer | 1247 } // namespace syncer |
| OLD | NEW |