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

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: scoped_ptr 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..a6d140e40cfb5619f474364e98c018ed8d1ab3c2 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