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

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

Issue 407073003: [SyncFS] Add completion callback to PromoteDemotedChanges (1/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_engine.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
index 73876cff8040d88f58724eb6e28b1201ead996a5..f0e65717570107889d237db7fc8f977927e98b2f 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -578,14 +578,20 @@ void SyncEngine::SetSyncEnabled(bool sync_enabled) {
sync_enabled));
}
-void SyncEngine::PromoteDemotedChanges() {
- if (!sync_worker_)
+void SyncEngine::PromoteDemotedChanges(const base::Closure& callback) {
+ if (!sync_worker_) {
+ callback.Run();
return;
+ }
+
+ base::Closure relayed_callback = RelayCallbackToCurrentThread(
+ FROM_HERE, callback_tracker_.Register(callback, callback));
worker_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SyncWorkerInterface::PromoteDemotedChanges,
- base::Unretained(sync_worker_.get())));
+ base::Unretained(sync_worker_.get()),
+ relayed_callback));
}
void SyncEngine::ApplyLocalChange(

Powered by Google App Engine
This is Rietveld 408576698