| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/sync/syncable/directory_backing_store.h" | 5 #include "chrome/browser/sync/syncable/directory_backing_store.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "chrome/browser/sync/protocol/service_constants.h" | 15 #include "chrome/browser/sync/protocol/service_constants.h" |
| 16 #include "chrome/browser/sync/syncable/syncable-inl.h" | 16 #include "chrome/browser/sync/syncable/syncable-inl.h" |
| 17 #include "chrome/browser/sync/syncable/syncable_columns.h" | 17 #include "chrome/browser/sync/syncable/syncable_columns.h" |
| 18 #include "chrome/browser/sync/util/crypto_helpers.h" | 18 #include "chrome/browser/sync/util/crypto_helpers.h" |
| 19 #include "chrome/browser/sync/util/path_helpers.h" | |
| 20 #include "chrome/browser/sync/util/query_helpers.h" | 19 #include "chrome/browser/sync/util/query_helpers.h" |
| 21 #include "third_party/sqlite/preprocessed/sqlite3.h" | 20 #include "third_party/sqlite/preprocessed/sqlite3.h" |
| 22 | 21 |
| 23 // Sometimes threads contend on the DB lock itself, especially when one thread | 22 // Sometimes threads contend on the DB lock itself, especially when one thread |
| 24 // is calling SaveChanges. In the worst case scenario, the user can put his | 23 // is calling SaveChanges. In the worst case scenario, the user can put his |
| 25 // laptop to sleep during db contention, and wake up the laptop days later, so | 24 // laptop to sleep during db contention, and wake up the laptop days later, so |
| 26 // infinity seems like the best choice here. | 25 // infinity seems like the best choice here. |
| 27 const int kDirectoryBackingStoreBusyTimeoutMs = std::numeric_limits<int>::max(); | 26 const int kDirectoryBackingStoreBusyTimeoutMs = std::numeric_limits<int>::max(); |
| 28 | 27 |
| 29 using std::string; | 28 using std::string; |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 600 |
| 602 sqlite3* DirectoryBackingStore::LazyGetSaveHandle() { | 601 sqlite3* DirectoryBackingStore::LazyGetSaveHandle() { |
| 603 if (!save_dbhandle_ && !OpenAndConfigureHandleHelper(&save_dbhandle_)) { | 602 if (!save_dbhandle_ && !OpenAndConfigureHandleHelper(&save_dbhandle_)) { |
| 604 DCHECK(FALSE) << "Unable to open handle for saving"; | 603 DCHECK(FALSE) << "Unable to open handle for saving"; |
| 605 return NULL; | 604 return NULL; |
| 606 } | 605 } |
| 607 return save_dbhandle_; | 606 return save_dbhandle_; |
| 608 } | 607 } |
| 609 | 608 |
| 610 } // namespace syncable | 609 } // namespace syncable |
| OLD | NEW |