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

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: Refactoring 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 e803138cc63f54dc31a50d9a61ba763ebaeb0f3f..da55f1766503d1c0b18efc80687435456e3b1602 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
@@ -204,8 +204,8 @@ RemoteServiceState SyncWorker::GetCurrentState() const {
}
void SyncWorker::GetOriginStatusMap(
- RemoteFileSyncService::OriginStatusMap* status_map) {
- DCHECK(status_map);
+ const RemoteFileSyncService::StatusMapCallback& callback) {
+ RemoteFileSyncService::OriginStatusMap status_map;
if (!GetMetadataDatabase())
return;
@@ -216,12 +216,12 @@ void SyncWorker::GetOriginStatusMap(
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);
- (*status_map)[origin] =
- GetMetadataDatabase()->IsAppEnabled(app_id) ?
+ GURL origin = extensions::Extension::GetBaseURLFromExtensionId(app_id);
+ status_map[origin] = GetMetadataDatabase()->IsAppEnabled(app_id) ?
"Enabled" : "Disabled";
}
+
+ callback.Run(status_map);
}
scoped_ptr<base::ListValue> SyncWorker::DumpFiles(const GURL& origin) {

Powered by Google App Engine
This is Rietveld 408576698