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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 268413002: [SyncFS] Make DumpFiles async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: work for a nit 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 RemoteServiceState SyncEngine::GetCurrentState() const { 294 RemoteServiceState SyncEngine::GetCurrentState() const {
295 // TODO(peria): Post task 295 // TODO(peria): Post task
296 return sync_worker_->GetCurrentState(); 296 return sync_worker_->GetCurrentState();
297 } 297 }
298 298
299 void SyncEngine::GetOriginStatusMap(OriginStatusMap* status_map) { 299 void SyncEngine::GetOriginStatusMap(OriginStatusMap* status_map) {
300 // TODO(peria): Make this route asynchronous. 300 // TODO(peria): Make this route asynchronous.
301 sync_worker_->GetOriginStatusMap(status_map); 301 sync_worker_->GetOriginStatusMap(status_map);
302 } 302 }
303 303
304 scoped_ptr<base::ListValue> SyncEngine::DumpFiles(const GURL& origin) { 304 void SyncEngine::DumpFiles(const GURL& origin,
305 // TODO(peria): Make this route asynchronous. 305 const ListCallback& callback) {
306 return sync_worker_->DumpFiles(origin); 306 PostTaskAndReplyWithResult(
307 worker_task_runner_,
308 FROM_HERE,
309 base::Bind(&SyncWorker::DumpFiles,
310 base::Unretained(sync_worker_.get()),
311 origin),
312 callback);
307 } 313 }
308 314
309 scoped_ptr<base::ListValue> SyncEngine::DumpDatabase() { 315 scoped_ptr<base::ListValue> SyncEngine::DumpDatabase() {
310 // TODO(peria): Make this route asynchronous. 316 // TODO(peria): Make this route asynchronous.
311 return sync_worker_->DumpDatabase(); 317 return sync_worker_->DumpDatabase();
312 } 318 }
313 319
314 void SyncEngine::SetSyncEnabled(bool enabled) { 320 void SyncEngine::SetSyncEnabled(bool enabled) {
315 worker_task_runner_->PostTask( 321 worker_task_runner_->PostTask(
316 FROM_HERE, 322 FROM_HERE,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; 528 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT;
523 if (is_app_enabled && !is_app_root_tracker_enabled) 529 if (is_app_enabled && !is_app_root_tracker_enabled)
524 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); 530 EnableOrigin(origin, base::Bind(&EmptyStatusCallback));
525 else if (!is_app_enabled && is_app_root_tracker_enabled) 531 else if (!is_app_enabled && is_app_root_tracker_enabled)
526 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); 532 DisableOrigin(origin, base::Bind(&EmptyStatusCallback));
527 } 533 }
528 } 534 }
529 535
530 } // namespace drive_backend 536 } // namespace drive_backend
531 } // namespace sync_file_system 537 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698