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

Unified Diff: chrome/browser/storage_monitor/storage_monitor.cc

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add StorageMonitor comment Created 7 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/storage_monitor/storage_monitor.cc
diff --git a/chrome/browser/storage_monitor/storage_monitor.cc b/chrome/browser/storage_monitor/storage_monitor.cc
index 682264223c40b147f4446a65e51ef9b9b042da53..47e50cc26779d4d00d4085bb3f174145a0465122 100644
--- a/chrome/browser/storage_monitor/storage_monitor.cc
+++ b/chrome/browser/storage_monitor/storage_monitor.cc
@@ -72,6 +72,10 @@ void StorageMonitor::Initialize(base::Closure callback) {
on_initialize_callbacks_.push_back(callback);
}
+ if (initializing_)
+ return;
+
+ initializing_ = true;
Init();
}
@@ -108,6 +112,7 @@ void StorageMonitor::EjectDevice(
StorageMonitor::StorageMonitor()
: observer_list_(new ObserverListThreadSafe<RemovableStorageObserver>()),
+ initializing_(false),
initialized_(false),
transient_device_ids_(new TransientDeviceIds) {
receiver_.reset(new ReceiverImpl(this));

Powered by Google App Engine
This is Rietveld 408576698