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

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

Issue 1349863003: [sql] Use memory-mapped I/O for sql::Connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: overreverted sync fix, needed to keep iOS fix 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, disble for
pval...(no longer on Chromium) 2015/09/22 16:57:33 s/disble/disable/
Scott Hess - ex-Googler 2015/09/22 19:59:14 Acknowledged.
1695 // now. http://crbug.com/533682
1696 db_->set_mmap_disabled();
1693 if (!catastrophic_error_handler_.is_null()) 1697 if (!catastrophic_error_handler_.is_null())
1694 SetCatastrophicErrorHandler(catastrophic_error_handler_); 1698 SetCatastrophicErrorHandler(catastrophic_error_handler_);
1695 } 1699 }
1696 1700
1697 void DirectoryBackingStore::SetCatastrophicErrorHandler( 1701 void DirectoryBackingStore::SetCatastrophicErrorHandler(
1698 const base::Closure& catastrophic_error_handler) { 1702 const base::Closure& catastrophic_error_handler) {
1699 DCHECK(CalledOnValidThread()); 1703 DCHECK(CalledOnValidThread());
1700 DCHECK(!catastrophic_error_handler.is_null()); 1704 DCHECK(!catastrophic_error_handler.is_null());
1701 catastrophic_error_handler_ = catastrophic_error_handler; 1705 catastrophic_error_handler_ = catastrophic_error_handler;
1702 sql::Connection::ErrorCallback error_callback = 1706 sql::Connection::ErrorCallback error_callback =
1703 base::Bind(&OnSqliteError, catastrophic_error_handler_); 1707 base::Bind(&OnSqliteError, catastrophic_error_handler_);
1704 db_->set_error_callback(error_callback); 1708 db_->set_error_callback(error_callback);
1705 } 1709 }
1706 1710
1707 } // namespace syncable 1711 } // namespace syncable
1708 } // namespace syncer 1712 } // 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