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

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

Issue 1533703002: [sql] Consider fresh databases suitable for memory-mapped I/O. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« sql/connection.cc ('K') | « sql/meta_table.cc ('k') | no next file » | 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 <limits> 7 #include <limits>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 return needs_metas_column_refresh_ || needs_share_info_column_refresh_; 1721 return needs_metas_column_refresh_ || needs_share_info_column_refresh_;
1722 } 1722 }
1723 1723
1724 void DirectoryBackingStore::ResetAndCreateConnection() { 1724 void DirectoryBackingStore::ResetAndCreateConnection() {
1725 db_.reset(new sql::Connection()); 1725 db_.reset(new sql::Connection());
1726 db_->set_histogram_tag("SyncDirectory"); 1726 db_->set_histogram_tag("SyncDirectory");
1727 db_->set_exclusive_locking(); 1727 db_->set_exclusive_locking();
1728 db_->set_cache_size(32); 1728 db_->set_cache_size(32);
1729 db_->set_page_size(database_page_size_); 1729 db_->set_page_size(database_page_size_);
1730 1730
1731 // TODO(shess): The current mitigation for http://crbug.com/537742 stores
1732 // state in the meta table, which this database does not use.
1733 db_->set_mmap_disabled();
1734
1731 // TODO(shess): Sync corruption tests interact poorly with mmap, disable for 1735 // TODO(shess): Sync corruption tests interact poorly with mmap, disable for
1732 // now. http://crbug.com/533682 1736 // now. http://crbug.com/533682
1733 db_->set_mmap_disabled(); 1737 db_->set_mmap_disabled();
rmcilroy 2015/12/17 10:03:22 You've already disabled it here - just add the TOD
Scott Hess - ex-Googler 2015/12/18 00:00:32 Derp. There's another CL in progress which was go
1734 if (!catastrophic_error_handler_.is_null()) 1738 if (!catastrophic_error_handler_.is_null())
1735 SetCatastrophicErrorHandler(catastrophic_error_handler_); 1739 SetCatastrophicErrorHandler(catastrophic_error_handler_);
1736 } 1740 }
1737 1741
1738 void DirectoryBackingStore::SetCatastrophicErrorHandler( 1742 void DirectoryBackingStore::SetCatastrophicErrorHandler(
1739 const base::Closure& catastrophic_error_handler) { 1743 const base::Closure& catastrophic_error_handler) {
1740 DCHECK(CalledOnValidThread()); 1744 DCHECK(CalledOnValidThread());
1741 DCHECK(!catastrophic_error_handler.is_null()); 1745 DCHECK(!catastrophic_error_handler.is_null());
1742 catastrophic_error_handler_ = catastrophic_error_handler; 1746 catastrophic_error_handler_ = catastrophic_error_handler;
1743 sql::Connection::ErrorCallback error_callback = 1747 sql::Connection::ErrorCallback error_callback =
1744 base::Bind(&OnSqliteError, catastrophic_error_handler_); 1748 base::Bind(&OnSqliteError, catastrophic_error_handler_);
1745 db_->set_error_callback(error_callback); 1749 db_->set_error_callback(error_callback);
1746 } 1750 }
1747 1751
1748 } // namespace syncable 1752 } // namespace syncable
1749 } // namespace syncer 1753 } // namespace syncer
OLDNEW
« sql/connection.cc ('K') | « sql/meta_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698