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

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
« no previous file with comments | « no previous file | sync/syncable/directory_backing_store.h » ('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 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 db_->set_page_size(databasePageSize_);
43 if (!db_->Open(backing_filepath_) || !InitializeTables()) 43 if (!db_->Open(backing_filepath_) || !InitializeTables())
44 return false; 44 return false;
45 45
46 db_is_on_disk_ = true; 46 db_is_on_disk_ = true;
47 } 47 }
48 48
49 return DirectoryBackingStore::SaveChanges(snapshot); 49 return DirectoryBackingStore::SaveChanges(snapshot);
50 } 50 }
51 51
52 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load( 52 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load(
(...skipping 12 matching lines...) Expand all
65 if (!LoadEntries(handles_map, metahandles_to_purge)) 65 if (!LoadEntries(handles_map, metahandles_to_purge))
66 return FAILED_DATABASE_CORRUPT; 66 return FAILED_DATABASE_CORRUPT;
67 if (!LoadInfo(kernel_load_info)) 67 if (!LoadInfo(kernel_load_info))
68 return FAILED_DATABASE_CORRUPT; 68 return FAILED_DATABASE_CORRUPT;
69 69
70 return OPENED; 70 return OPENED;
71 } 71 }
72 72
73 } // namespace syncable 73 } // namespace syncable
74 } // namespace syncer 74 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698