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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_worker.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 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 ca3f5cdcaa6bc4065a40a141f2b96b5d8f946782..c2b7f87f6c4845a891b87221d8f8b1b5d3f5d626 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
@@ -204,24 +204,24 @@ RemoteServiceState SyncWorker::GetCurrentState() const {
}
void SyncWorker::GetOriginStatusMap(
- RemoteFileSyncService::OriginStatusMap* status_map) {
- DCHECK(status_map);
-
+ const RemoteFileSyncService::StatusMapCallback& callback) {
if (!GetMetadataDatabase())
return;
std::vector<std::string> app_ids;
GetMetadataDatabase()->GetRegisteredAppIDs(&app_ids);
+ scoped_ptr<RemoteFileSyncService::OriginStatusMap>
+ status_map(new RemoteFileSyncService::OriginStatusMap);
for (std::vector<std::string>::const_iterator itr = app_ids.begin();
itr != app_ids.end(); ++itr) {
const std::string& app_id = *itr;
- GURL origin =
- extensions::Extension::GetBaseURLFromExtensionId(app_id);
+ GURL origin = extensions::Extension::GetBaseURLFromExtensionId(app_id);
(*status_map)[origin] =
- GetMetadataDatabase()->IsAppEnabled(app_id) ?
- "Enabled" : "Disabled";
+ GetMetadataDatabase()->IsAppEnabled(app_id) ? "Enabled" : "Disabled";
}
+
+ callback.Run(status_map.Pass());
}
scoped_ptr<base::ListValue> SyncWorker::DumpFiles(const GURL& origin) {

Powered by Google App Engine
This is Rietveld 408576698