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

Unified Diff: chrome/browser/system_monitor/removable_storage_notifications.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working on windows Created 7 years, 11 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/system_monitor/removable_storage_notifications.cc
diff --git a/chrome/browser/system_monitor/removable_storage_notifications.cc b/chrome/browser/system_monitor/removable_storage_notifications.cc
index 05014f86cb7abb8dae8ae9cbad329f8d4ba314fb..8520d849d4565a3efcada88d7e049692a7a79f83 100644
--- a/chrome/browser/system_monitor/removable_storage_notifications.cc
+++ b/chrome/browser/system_monitor/removable_storage_notifications.cc
@@ -10,6 +10,9 @@
namespace chrome {
+static RemovableStorageNotifications*
+ g_removable_storage_notifications = NULL;
+
RemovableStorageNotifications::StorageInfo::StorageInfo() {
}
@@ -25,9 +28,13 @@ RemovableStorageNotifications::StorageInfo::StorageInfo(
RemovableStorageNotifications::RemovableStorageNotifications()
: observer_list_(
new ObserverListThreadSafe<RemovableStorageObserver>()) {
+ DCHECK(!g_removable_storage_notifications);
+ g_removable_storage_notifications = this;
}
RemovableStorageNotifications::~RemovableStorageNotifications() {
+ DCHECK_EQ(this, g_removable_storage_notifications);
+ g_removable_storage_notifications = NULL;
}
void RemovableStorageNotifications::ProcessAttach(
@@ -90,4 +97,8 @@ void RemovableStorageNotifications::RemoveObserver(
observer_list_->RemoveObserver(obs);
}
+RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() {
+ return g_removable_storage_notifications;
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698