Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Side by Side Diff: sync/syncable/directory_backing_store.cc

Issue 1365783002: Revert of [sql] Use memory-mapped I/O for sql::Connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sql/statement.cc ('k') | third_party/sqlite/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_backing_store.h" 5 #include "sync/syncable/directory_backing_store.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 bool DirectoryBackingStore::needs_column_refresh() const { 1683 bool DirectoryBackingStore::needs_column_refresh() const {
1684 return needs_column_refresh_; 1684 return needs_column_refresh_;
1685 } 1685 }
1686 1686
1687 void DirectoryBackingStore::ResetAndCreateConnection() { 1687 void DirectoryBackingStore::ResetAndCreateConnection() {
1688 db_.reset(new sql::Connection()); 1688 db_.reset(new sql::Connection());
1689 db_->set_histogram_tag("SyncDirectory"); 1689 db_->set_histogram_tag("SyncDirectory");
1690 db_->set_exclusive_locking(); 1690 db_->set_exclusive_locking();
1691 db_->set_cache_size(32); 1691 db_->set_cache_size(32);
1692 db_->set_page_size(database_page_size_); 1692 db_->set_page_size(database_page_size_);
1693
1694 // TODO(shess): Sync corruption tests interact poorly with mmap, disable for
1695 // now. http://crbug.com/533682
1696 db_->set_mmap_disabled();
1697 if (!catastrophic_error_handler_.is_null()) 1693 if (!catastrophic_error_handler_.is_null())
1698 SetCatastrophicErrorHandler(catastrophic_error_handler_); 1694 SetCatastrophicErrorHandler(catastrophic_error_handler_);
1699 } 1695 }
1700 1696
1701 void DirectoryBackingStore::SetCatastrophicErrorHandler( 1697 void DirectoryBackingStore::SetCatastrophicErrorHandler(
1702 const base::Closure& catastrophic_error_handler) { 1698 const base::Closure& catastrophic_error_handler) {
1703 DCHECK(CalledOnValidThread()); 1699 DCHECK(CalledOnValidThread());
1704 DCHECK(!catastrophic_error_handler.is_null()); 1700 DCHECK(!catastrophic_error_handler.is_null());
1705 catastrophic_error_handler_ = catastrophic_error_handler; 1701 catastrophic_error_handler_ = catastrophic_error_handler;
1706 sql::Connection::ErrorCallback error_callback = 1702 sql::Connection::ErrorCallback error_callback =
1707 base::Bind(&OnSqliteError, catastrophic_error_handler_); 1703 base::Bind(&OnSqliteError, catastrophic_error_handler_);
1708 db_->set_error_callback(error_callback); 1704 db_->set_error_callback(error_callback);
1709 } 1705 }
1710 1706
1711 } // namespace syncable 1707 } // namespace syncable
1712 } // namespace syncer 1708 } // namespace syncer
OLDNEW
« no previous file with comments | « sql/statement.cc ('k') | third_party/sqlite/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698