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

Unified Diff: chrome/browser/media_galleries/media_file_system_registry.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/media_galleries/media_file_system_registry.cc
diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc
index 88c3752ae5d316cc9e23e7577ac965b23e2babde..d9b4b1ea55edadf8fa657ca0087790485165a3e5 100644
--- a/chrome/browser/media_galleries/media_file_system_registry.cc
+++ b/chrome/browser/media_galleries/media_file_system_registry.cc
@@ -468,11 +468,12 @@ MediaGalleriesPreferences* MediaFileSystemRegistry::GetPreferences(
// once per profile.
extension_hosts_map_[profile] = ExtensionHostMap();
- // TODO(gbillock): Move this stanza to MediaGalleriesPreferences init code.
vandebo (ex-Chrome) 2013/05/31 18:05:03 I think we still want to do this, leave in todo?
Greg Billock 2013/06/01 01:48:46 Yeah, I think this was impossible with the getting
// StorageMonitor may be NULL in unit tests.
+ // TODO(gbillock): Make sure all tests have a storage monitor and remove this.
StorageMonitor* monitor = StorageMonitor::GetInstance();
if (!monitor)
return preferences;
+ DCHECK(monitor->IsInitialized());
std::vector<StorageInfo> existing_devices = monitor->GetAttachedStorage();
for (size_t i = 0; i < existing_devices.size(); i++) {
if (!StorageInfo::IsMediaDevice(existing_devices[i].device_id()))

Powered by Google App Engine
This is Rietveld 408576698