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

Unified Diff: base/system_monitor/system_monitor.cc

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix shared_build compile error. Created 8 years, 5 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: base/system_monitor/system_monitor.cc
diff --git a/base/system_monitor/system_monitor.cc b/base/system_monitor/system_monitor.cc
index 6db1db582646ad2b8d1b0b39cc7c0ebeb7a136b4..7c0f58e3e69ec8b216b495a9cd45e10213536d45 100644
--- a/base/system_monitor/system_monitor.cc
+++ b/base/system_monitor/system_monitor.cc
@@ -104,9 +104,11 @@ void SystemMonitor::ProcessMediaDeviceAttached(
void SystemMonitor::ProcessMediaDeviceDetached(const std::string& id) {
MediaDeviceMap::iterator it = media_device_map_.find(id);
- if (it != media_device_map_.end())
- media_device_map_.erase(it);
- NotifyMediaDeviceDetached(id);
+ if (it == media_device_map_.end())
+ return;
+
+ NotifyMediaDeviceDetached(id, it->second.location);
+ media_device_map_.erase(it);
}
std::vector<SystemMonitor::MediaDeviceInfo>
@@ -153,10 +155,12 @@ void SystemMonitor::NotifyMediaDeviceAttached(
&DevicesChangedObserver::OnMediaDeviceAttached, id, name, type, location);
}
-void SystemMonitor::NotifyMediaDeviceDetached(const std::string& id) {
+void SystemMonitor::NotifyMediaDeviceDetached(
+ const std::string& id,
+ const FilePath::StringType& location) {
DVLOG(1) << "MediaDeviceDetached for id " << id;
devices_changed_observer_list_->Notify(
- &DevicesChangedObserver::OnMediaDeviceDetached, id);
+ &DevicesChangedObserver::OnMediaDeviceDetached, id, location);
}
void SystemMonitor::NotifyPowerStateChange() {

Powered by Google App Engine
This is Rietveld 408576698