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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc

Issue 297803011: [SyncFS] Run LocalToRemoteSyncer as SyncTask (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
index 346961d677e1acc6d0865f7c80219aa0d2b2c527..ffc8682dab8fc6d3b85823659e9a7dc5b1999b50 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
@@ -124,6 +124,14 @@ void SyncTaskManager::NotifyTaskDone(scoped_ptr<SyncTaskToken> token,
DCHECK(token);
SyncTaskManager* manager = token->manager();
+ if (token->token_id() == SyncTaskToken::kTestingTaskTokenID) {
+ DCHECK(!manager);
+ SyncStatusCallback callback = token->callback();
+ token->clear_callback();
+ callback.Run(status);
+ return;
+ }
+
if (manager)
manager->NotifyTaskDoneBody(token.Pass(), status);
}
@@ -136,6 +144,12 @@ void SyncTaskManager::UpdateBlockingFactor(
DCHECK(current_task_token);
SyncTaskManager* manager = current_task_token->manager();
+ if (current_task_token->token_id() == SyncTaskToken::kTestingTaskTokenID) {
+ DCHECK(!manager);
+ continuation.Run(current_task_token.Pass());
+ return;
+ }
+
if (!manager)
return;

Powered by Google App Engine
This is Rietveld 408576698