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

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

Issue 288193002: [SyncFS] Construct and destruct sync_worker in worker_task_runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work for comments 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_worker.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
index c2b7f87f6c4845a891b87221d8f8b1b5d3f5d626..a8a183c8e031ca7a52734963751cdcbfdc664ccf 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
@@ -85,6 +85,7 @@ void QueryAppStatusOnUIThread(
} // namespace
+// static
scoped_ptr<SyncWorker> SyncWorker::CreateOnWorker(
const base::FilePath& base_dir,
Observer* observer,
@@ -97,7 +98,6 @@ scoped_ptr<SyncWorker> SyncWorker::CreateOnWorker(
sync_engine_context.Pass(),
env_override));
sync_worker->AddObserver(observer);
- sync_worker->Initialize();
return sync_worker.Pass();
}
@@ -133,7 +133,6 @@ void SyncWorker::RegisterOrigin(
return;
}
- // TODO(peria): Forward |callback| to UI thread.
task_manager_->ScheduleSyncTask(
FROM_HERE,
task.PassAs<SyncTask>(),
@@ -144,7 +143,6 @@ void SyncWorker::RegisterOrigin(
void SyncWorker::EnableOrigin(
const GURL& origin,
const SyncStatusCallback& callback) {
- // TODO(peria): Forward |callback| to UI thread.
task_manager_->ScheduleTask(
FROM_HERE,
base::Bind(&SyncWorker::DoEnableApp,
@@ -157,7 +155,6 @@ void SyncWorker::EnableOrigin(
void SyncWorker::DisableOrigin(
const GURL& origin,
const SyncStatusCallback& callback) {
- // TODO(peria): Forward |callback| to UI thread.
task_manager_->ScheduleTask(
FROM_HERE,
base::Bind(&SyncWorker::DoDisableApp,
@@ -171,7 +168,6 @@ void SyncWorker::UninstallOrigin(
const GURL& origin,
RemoteFileSyncService::UninstallFlag flag,
const SyncStatusCallback& callback) {
- // TODO(peria): Forward |callback| to UI thread.
task_manager_->ScheduleSyncTask(
FROM_HERE,
scoped_ptr<SyncTask>(
@@ -189,7 +185,8 @@ void SyncWorker::ProcessRemoteChange(
SyncTaskManager::PRIORITY_MED,
base::Bind(&SyncWorker::DidProcessRemoteChange,
weak_ptr_factory_.GetWeakPtr(),
- syncer, callback));
+ syncer,
+ callback));
}
void SyncWorker::SetRemoteChangeProcessor(
@@ -291,7 +288,8 @@ void SyncWorker::ApplyLocalChange(
SyncTaskManager::PRIORITY_MED,
base::Bind(&SyncWorker::DidApplyLocalChange,
weak_ptr_factory_.GetWeakPtr(),
- syncer, callback));
+ syncer,
+ callback));
}
void SyncWorker::MaybeScheduleNextTask() {

Powered by Google App Engine
This is Rietveld 408576698