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

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

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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/deferred_on_disk_directory_backing_store.h" 5 #include "sync/syncable/deferred_on_disk_directory_backing_store.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "sync/syncable/syncable-inl.h" 10 #include "sync/syncable/syncable-inl.h"
(...skipping 21 matching lines...) Expand all
32 return true; 32 return true;
33 } 33 }
34 34
35 if (!db_is_on_disk_) { 35 if (!db_is_on_disk_) {
36 if (!base::DeleteFile(backing_filepath_, false)) 36 if (!base::DeleteFile(backing_filepath_, false))
37 return false; 37 return false;
38 38
39 // Reopen DB on disk. 39 // Reopen DB on disk.
40 db_.reset(new sql::Connection); 40 db_.reset(new sql::Connection);
41 db_->set_exclusive_locking(); 41 db_->set_exclusive_locking();
42 db_->set_page_size(4096); 42 if (IsSyncBackingDatabase32KEnabled()) {
43 db_->set_page_size(32768);
44 } else {
45 db_->set_page_size(4096);
46 }
43 if (!db_->Open(backing_filepath_) || !InitializeTables()) 47 if (!db_->Open(backing_filepath_) || !InitializeTables())
44 return false; 48 return false;
45 49
46 db_is_on_disk_ = true; 50 db_is_on_disk_ = true;
47 } 51 }
48 52
49 return DirectoryBackingStore::SaveChanges(snapshot); 53 return DirectoryBackingStore::SaveChanges(snapshot);
50 } 54 }
51 55
52 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load( 56 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load(
(...skipping 11 matching lines...) Expand all
64 if (!LoadEntries(handles_map)) 68 if (!LoadEntries(handles_map))
65 return FAILED_DATABASE_CORRUPT; 69 return FAILED_DATABASE_CORRUPT;
66 if (!LoadInfo(kernel_load_info)) 70 if (!LoadInfo(kernel_load_info))
67 return FAILED_DATABASE_CORRUPT; 71 return FAILED_DATABASE_CORRUPT;
68 72
69 return OPENED; 73 return OPENED;
70 } 74 }
71 75
72 } // namespace syncable 76 } // namespace syncable
73 } // namespace syncer 77 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/directory_backing_store.h » ('j') | sync/syncable/on_disk_directory_backing_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698