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

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

Issue 1016563005: Increase page size for SyncData DB from 4K to maximum supported 32K (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 #ifndef SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 26 matching lines...) Expand all
37 // The DirectoryBackingStore will own an sqlite lock on its database for most of 37 // The DirectoryBackingStore will own an sqlite lock on its database for most of
38 // its lifetime. You must not have two DirectoryBackingStore objects accessing 38 // its lifetime. You must not have two DirectoryBackingStore objects accessing
39 // the database simultaneously. Because the lock exists at the database level, 39 // the database simultaneously. Because the lock exists at the database level,
40 // not even two separate browser instances would be able to acquire it 40 // not even two separate browser instances would be able to acquire it
41 // simultaneously. 41 // simultaneously.
42 // 42 //
43 // This class is abstract so that we can extend it in interesting ways for use 43 // This class is abstract so that we can extend it in interesting ways for use
44 // in tests. The concrete class used in non-test scenarios is 44 // in tests. The concrete class used in non-test scenarios is
45 // OnDiskDirectoryBackingStore. 45 // OnDiskDirectoryBackingStore.
46 class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe { 46 class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe {
47 friend class DirectoryBackingStoreTest;
48 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest,
49 IncreaseDatabasePageSizeFrom4KTo32K);
50
47 public: 51 public:
48 explicit DirectoryBackingStore(const std::string& dir_name); 52 explicit DirectoryBackingStore(const std::string& dir_name);
49 virtual ~DirectoryBackingStore(); 53 virtual ~DirectoryBackingStore();
50 54
51 // Loads and drops all currently persisted meta entries into |handles_map| 55 // Loads and drops all currently persisted meta entries into |handles_map|
52 // and loads appropriate persisted kernel info into |kernel_load_info|. 56 // and loads appropriate persisted kernel info into |kernel_load_info|.
53 // The function determines which entries can be safely dropped and inserts 57 // The function determines which entries can be safely dropped and inserts
54 // their keys into |metahandles_to_purge|. It is up to the caller to 58 // their keys into |metahandles_to_purge|. It is up to the caller to
55 // perform the actual cleanup. 59 // perform the actual cleanup.
56 // 60 //
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 142
139 // Checks that the references between sync nodes is consistent. 143 // Checks that the references between sync nodes is consistent.
140 static bool VerifyReferenceIntegrity( 144 static bool VerifyReferenceIntegrity(
141 const Directory::MetahandlesMap* handles_map); 145 const Directory::MetahandlesMap* handles_map);
142 146
143 // Migration utilities. 147 // Migration utilities.
144 bool RefreshColumns(); 148 bool RefreshColumns();
145 bool SetVersion(int version); 149 bool SetVersion(int version);
146 int GetVersion(); 150 int GetVersion();
147 151
152 bool GetDatabasePageSize(int* page_size);
153 bool IsSyncBackingDatabase32KEnabled();
154 bool IncreasePageSizeTo32K();
155 bool Vacuum();
156 int databasePageSize_;
157
148 bool MigrateToSpecifics(const char* old_columns, 158 bool MigrateToSpecifics(const char* old_columns,
149 const char* specifics_column, 159 const char* specifics_column,
150 void(*handler_function) ( 160 void(*handler_function) (
151 sql::Statement* old_value_query, 161 sql::Statement* old_value_query,
152 int old_value_column, 162 int old_value_column,
153 sync_pb::EntitySpecifics* mutable_new_value)); 163 sync_pb::EntitySpecifics* mutable_new_value));
154 164
155 // Individual version migrations. 165 // Individual version migrations.
156 bool MigrateVersion67To68(); 166 bool MigrateVersion67To68();
157 bool MigrateVersion68To69(); 167 bool MigrateVersion68To69();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void PrepareSaveEntryStatement(EntryTable table, 200 void PrepareSaveEntryStatement(EntryTable table,
191 sql::Statement* save_statement); 201 sql::Statement* save_statement);
192 202
193 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); 203 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore);
194 }; 204 };
195 205
196 } // namespace syncable 206 } // namespace syncable
197 } // namespace syncer 207 } // namespace syncer
198 208
199 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 209 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « sync/syncable/deferred_on_disk_directory_backing_store.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698