OLD | NEW |
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 "components/sync/syncable/directory_backing_store.h" | 5 #include "components/sync/syncable/directory_backing_store.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 bool DirectoryBackingStore::needs_column_refresh() const { | 1742 bool DirectoryBackingStore::needs_column_refresh() const { |
1743 return needs_metas_column_refresh_ || needs_share_info_column_refresh_; | 1743 return needs_metas_column_refresh_ || needs_share_info_column_refresh_; |
1744 } | 1744 } |
1745 | 1745 |
1746 void DirectoryBackingStore::ResetAndCreateConnection() { | 1746 void DirectoryBackingStore::ResetAndCreateConnection() { |
1747 db_ = base::MakeUnique<sql::Connection>(); | 1747 db_ = base::MakeUnique<sql::Connection>(); |
1748 db_->set_histogram_tag("SyncDirectory"); | 1748 db_->set_histogram_tag("SyncDirectory"); |
1749 db_->set_cache_size(32); | 1749 db_->set_cache_size(32); |
1750 db_->set_page_size(database_page_size_); | 1750 db_->set_page_size(database_page_size_); |
1751 | 1751 |
1752 // TODO(shess): The current mitigation for http://crbug.com/537742 stores | 1752 // This db does not use [meta] table, store mmap status data elsewhere. |
1753 // state in the meta table, which this database does not use. | 1753 db_->set_mmap_alt_status(); |
1754 db_->set_mmap_disabled(); | |
1755 | 1754 |
1756 if (!catastrophic_error_handler_.is_null()) | 1755 if (!catastrophic_error_handler_.is_null()) |
1757 SetCatastrophicErrorHandler(catastrophic_error_handler_); | 1756 SetCatastrophicErrorHandler(catastrophic_error_handler_); |
1758 } | 1757 } |
1759 | 1758 |
1760 void DirectoryBackingStore::SetCatastrophicErrorHandler( | 1759 void DirectoryBackingStore::SetCatastrophicErrorHandler( |
1761 const base::Closure& catastrophic_error_handler) { | 1760 const base::Closure& catastrophic_error_handler) { |
1762 DCHECK(CalledOnValidThread()); | 1761 DCHECK(CalledOnValidThread()); |
1763 DCHECK(!catastrophic_error_handler.is_null()); | 1762 DCHECK(!catastrophic_error_handler.is_null()); |
1764 catastrophic_error_handler_ = catastrophic_error_handler; | 1763 catastrophic_error_handler_ = catastrophic_error_handler; |
1765 sql::Connection::ErrorCallback error_callback = | 1764 sql::Connection::ErrorCallback error_callback = |
1766 base::Bind(&OnSqliteError, catastrophic_error_handler_); | 1765 base::Bind(&OnSqliteError, catastrophic_error_handler_); |
1767 db_->set_error_callback(error_callback); | 1766 db_->set_error_callback(error_callback); |
1768 } | 1767 } |
1769 | 1768 |
1770 } // namespace syncable | 1769 } // namespace syncable |
1771 } // namespace syncer | 1770 } // namespace syncer |
OLD | NEW |