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

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

Issue 294893005: [SyncFS] Make GetOriginStatusMap asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | Annotate | Revision Log
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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 337 }
338 338
339 LocalChangeProcessor* SyncEngine::GetLocalChangeProcessor() { 339 LocalChangeProcessor* SyncEngine::GetLocalChangeProcessor() {
340 return this; 340 return this;
341 } 341 }
342 342
343 RemoteServiceState SyncEngine::GetCurrentState() const { 343 RemoteServiceState SyncEngine::GetCurrentState() const {
344 return service_state_; 344 return service_state_;
345 } 345 }
346 346
347 void SyncEngine::GetOriginStatusMap(OriginStatusMap* status_map) { 347 void SyncEngine::GetOriginStatusMap(const StatusMapCallback& callback) {
348 // TODO(peria): Make this route asynchronous. 348 worker_task_runner_->PostTask(
349 sync_worker_->GetOriginStatusMap(status_map); 349 FROM_HERE,
350 base::Bind(&SyncWorker::GetOriginStatusMap,
351 base::Unretained(sync_worker_.get()),
352 RelayCallbackToCurrentThread(FROM_HERE, callback)));
350 } 353 }
351 354
352 void SyncEngine::DumpFiles(const GURL& origin, 355 void SyncEngine::DumpFiles(const GURL& origin,
353 const ListCallback& callback) { 356 const ListCallback& callback) {
354 PostTaskAndReplyWithResult( 357 PostTaskAndReplyWithResult(
355 worker_task_runner_, 358 worker_task_runner_,
356 FROM_HERE, 359 FROM_HERE,
357 base::Bind(&SyncWorker::DumpFiles, 360 base::Bind(&SyncWorker::DumpFiles,
358 base::Unretained(sync_worker_.get()), 361 base::Unretained(sync_worker_.get()),
359 origin), 362 origin),
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; 540 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT;
538 if (is_app_enabled && !is_app_root_tracker_enabled) 541 if (is_app_enabled && !is_app_root_tracker_enabled)
539 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); 542 EnableOrigin(origin, base::Bind(&EmptyStatusCallback));
540 else if (!is_app_enabled && is_app_root_tracker_enabled) 543 else if (!is_app_enabled && is_app_root_tracker_enabled)
541 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); 544 DisableOrigin(origin, base::Bind(&EmptyStatusCallback));
542 } 545 }
543 } 546 }
544 547
545 } // namespace drive_backend 548 } // namespace drive_backend
546 } // namespace sync_file_system 549 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698