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

Unified Diff: sync/syncable/on_disk_directory_backing_store.cc

Issue 1008103002: Sync: Avoid 3 passes over SyncDarta DB when loading the directory from the disk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/syncable/on_disk_directory_backing_store.h ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/on_disk_directory_backing_store.cc
diff --git a/sync/syncable/on_disk_directory_backing_store.cc b/sync/syncable/on_disk_directory_backing_store.cc
index 1bebf9aff2f79557fe30702c98b957e752726fe2..dcbaeddb9cd232ecf60ac006a2142d6a66f4c6de 100644
--- a/sync/syncable/on_disk_directory_backing_store.cc
+++ b/sync/syncable/on_disk_directory_backing_store.cc
@@ -37,6 +37,7 @@ OnDiskDirectoryBackingStore::~OnDiskDirectoryBackingStore() { }
DirOpenResult OnDiskDirectoryBackingStore::TryLoad(
Directory::MetahandlesMap* handles_map,
JournalIndex* delete_journals,
+ MetahandleSet* metahandles_to_purge,
Directory::KernelLoadInfo* kernel_load_info) {
DCHECK(CalledOnValidThread());
if (!db_->is_open()) {
@@ -47,9 +48,7 @@ DirOpenResult OnDiskDirectoryBackingStore::TryLoad(
if (!InitializeTables())
return FAILED_OPEN_DATABASE;
- if (!DropDeletedEntries())
- return FAILED_DATABASE_CORRUPT;
- if (!LoadEntries(handles_map))
+ if (!LoadEntries(handles_map, metahandles_to_purge))
return FAILED_DATABASE_CORRUPT;
if (!LoadDeleteJournals(delete_journals))
return FAILED_DATABASE_CORRUPT;
@@ -65,9 +64,10 @@ DirOpenResult OnDiskDirectoryBackingStore::TryLoad(
DirOpenResult OnDiskDirectoryBackingStore::Load(
Directory::MetahandlesMap* handles_map,
JournalIndex* delete_journals,
+ MetahandleSet* metahandles_to_purge,
Directory::KernelLoadInfo* kernel_load_info) {
DirOpenResult result = TryLoad(handles_map, delete_journals,
- kernel_load_info);
+ metahandles_to_purge, kernel_load_info);
if (result == OPENED) {
UMA_HISTOGRAM_ENUMERATION(
"Sync.DirectoryOpenResult", FIRST_TRY_SUCCESS, RESULT_COUNT);
@@ -89,7 +89,8 @@ DirOpenResult OnDiskDirectoryBackingStore::Load(
db_->set_histogram_tag("SyncDirectory");
base::DeleteFile(backing_filepath_, false);
- result = TryLoad(handles_map, delete_journals, kernel_load_info);
+ result = TryLoad(handles_map, delete_journals, metahandles_to_purge,
+ kernel_load_info);
if (result == OPENED) {
UMA_HISTOGRAM_ENUMERATION(
"Sync.DirectoryOpenResult", SECOND_TRY_SUCCESS, RESULT_COUNT);
« no previous file with comments | « sync/syncable/on_disk_directory_backing_store.h ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698