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

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

Issue 10917166: Extend the capability of SystemMonitor to support watching storage free space change (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: updated patch Created 8 years, 3 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_device_notifications_linux.cc
diff --git a/chrome/browser/system_monitor/removable_device_notifications_linux.cc b/chrome/browser/system_monitor/removable_device_notifications_linux.cc
index e474b36dc396287f109ed05ab41706f4a9630b8f..cd6650270bb65754aec76ea467d769b000901b9f 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_linux.cc
+++ b/chrome/browser/system_monitor/removable_device_notifications_linux.cc
@@ -241,6 +241,9 @@ RemovableDeviceNotificationsLinux::RemovableDeviceNotificationsLinux(
get_device_info_func_(&GetDeviceInfo) {
DCHECK(!g_removable_device_notifications_linux);
g_removable_device_notifications_linux = this;
+
+ if (SystemMonitor::Get())
+ SystemMonitor::Get()->set_storage_free_space_delegate(this);
}
RemovableDeviceNotificationsLinux::RemovableDeviceNotificationsLinux(
@@ -257,6 +260,9 @@ RemovableDeviceNotificationsLinux::~RemovableDeviceNotificationsLinux() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_EQ(this, g_removable_device_notifications_linux);
g_removable_device_notifications_linux = NULL;
+ if (SystemMonitor::Get() &&
+ SystemMonitor::Get()->storage_free_space_delegate())
+ SystemMonitor::Get()->set_storage_free_space_delegate(NULL);
}
// static
@@ -356,6 +362,9 @@ void RemovableDeviceNotificationsLinux::InitOnFileThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
initialized_ = true;
+ if (SystemMonitor::Get())
+ SystemMonitor::Get()->set_storage_free_space_delegate(this);
+
// The callback passed to Watch() has to be unretained. Otherwise
// RemovableDeviceNotificationsLinux will live longer than expected, and
// FilePathWatcher will get in trouble at shutdown time.
@@ -506,4 +515,14 @@ void RemovableDeviceNotificationsLinux::AddNewMount(
}
}
+void RemovableDeviceNotificationsLinux::StartWatchingStorage(
+ const FilePath& path) {
+ NOTIMPLEMENTED();
+}
+
+void RemovableDeviceNotificationsLinux::StopWatchingStorage(
+ const FilePath& path) {
+ NOTIMPLEMENTED();
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698