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

Unified Diff: chrome/browser/apps/drive/drive_app_provider.cc

Issue 1130903006: cros: Fix DriveAppProvider racing during initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/apps/drive/drive_app_provider.cc
diff --git a/chrome/browser/apps/drive/drive_app_provider.cc b/chrome/browser/apps/drive/drive_app_provider.cc
index 15be11005cf990451876c2beb24f9fb608b5f540..a8f2fee9012cc5821d01924784f722fa23466f45 100644
--- a/chrome/browser/apps/drive/drive_app_provider.cc
+++ b/chrome/browser/apps/drive/drive_app_provider.cc
@@ -42,6 +42,7 @@ DriveAppProvider::DriveAppProvider(
uninstall_sync_service_(uninstall_sync_service),
service_bridge_(DriveServiceBridge::Create(profile).Pass()),
mapping_(new DriveAppMapping(profile->GetPrefs())),
+ drive_app_registry_updated_(false),
weak_ptr_factory_(this) {
service_bridge_->GetAppRegistry()->AddObserver(this);
ExtensionRegistry::Get(profile_)->AddObserver(this);
@@ -236,6 +237,9 @@ void DriveAppProvider::ProcessRemovedDriveApp(const std::string& drive_app_id) {
}
void DriveAppProvider::UpdateDriveApps() {
+ if (!drive_app_registry_updated_)
+ return;
+
service_bridge_->GetAppRegistry()->GetAppList(&drive_apps_);
IdSet current_ids;
@@ -266,6 +270,7 @@ void DriveAppProvider::UpdateDriveApps() {
}
void DriveAppProvider::OnDriveAppRegistryUpdated() {
+ drive_app_registry_updated_ = true;
UpdateDriveApps();
}
« no previous file with comments | « chrome/browser/apps/drive/drive_app_provider.h ('k') | chrome/browser/apps/drive/drive_app_provider_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698