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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 11418305: Fix incremental sync behavior of DriveFileSyncService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drop unreached case Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc
index e0edc101ece985f4c1455178f2fed993ed1668c3..5183af9f0fec1071171bb0a139f10023fd27e111 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc
@@ -139,7 +139,6 @@ struct DriveFileSyncService::ProcessRemoteChangeParam {
fileapi::SyncOperationCallback callback;
DriveMetadata drive_metadata;
- bool missing_db_entry;
bool metadata_updated;
FilePath temporary_file_path;
std::string md5_checksum;
@@ -153,7 +152,6 @@ struct DriveFileSyncService::ProcessRemoteChangeParam {
processor(processor),
remote_change(remote_change),
callback(callback),
- missing_db_entry(false),
metadata_updated(false),
operation_type(fileapi::SYNC_OPERATION_NONE) {
}
@@ -1142,7 +1140,10 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
if (local_changes.empty()) {
if (missing_local_file) {
param->operation_type = fileapi::SYNC_OPERATION_NONE;
- DeleteMetadataForRemoteSync(param.Pass());
+ if (missing_db_entry)
+ CompleteRemoteSync(param.Pass(), fileapi::SYNC_STATUS_OK);
+ else
+ DeleteMetadataForRemoteSync(param.Pass());
return;
}
DCHECK(!missing_local_file);
@@ -1165,7 +1166,10 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
DCHECK(local_changes.list().back().IsDelete());
param->operation_type = fileapi::SYNC_OPERATION_NONE;
- DeleteMetadataForRemoteSync(param.Pass());
+ if (missing_db_entry)
+ CompleteRemoteSync(param.Pass(), fileapi::SYNC_STATUS_OK);
+ else
+ DeleteMetadataForRemoteSync(param.Pass());
}
void DriveFileSyncService::DownloadForRemoteSync(
@@ -1403,7 +1407,7 @@ void DriveFileSyncService::FetchChangesForIncrementalSync() {
}
sync_client_->ListChanges(
- largest_fetched_changestamp_,
+ largest_fetched_changestamp_ + 1,
base::Bind(&DriveFileSyncService::DidFetchChangesForIncrementalSync,
AsWeakPtr(), base::Passed(&token)));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698