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

Unified Diff: device/base/device_monitor_linux.cc

Issue 2417043002: Move device/core files to device/base directory. (Closed)
Patch Set: Fix ChromeOS build Created 4 years, 2 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
« no previous file with comments | « device/base/device_monitor_linux.h ('k') | device/base/device_monitor_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/base/device_monitor_linux.cc
diff --git a/device/core/device_monitor_linux.cc b/device/base/device_monitor_linux.cc
similarity index 91%
rename from device/core/device_monitor_linux.cc
rename to device/base/device_monitor_linux.cc
index 73841611c9a8d4cd12530ef205361dc2a7b07f4f..cc64870b8cf17392507039756fe43eeef33af6ca 100644
--- a/device/core/device_monitor_linux.cc
+++ b/device/base/device_monitor_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "device/core/device_monitor_linux.h"
+#include "device/base/device_monitor_linux.h"
#include <memory>
@@ -111,7 +111,8 @@ void DeviceMonitorLinux::Enumerate(const EnumerateCallback& callback) {
void DeviceMonitorLinux::WillDestroyCurrentMessageLoop() {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(Observer, observers_, WillDestroyMonitorMessageLoop());
+ for (auto& observer : observers_)
+ observer.WillDestroyMonitorMessageLoop();
g_device_monitor_linux_ptr.Get().reset(nullptr);
}
@@ -129,10 +130,13 @@ void DeviceMonitorLinux::OnMonitorCanReadWithoutBlocking() {
return;
std::string action(udev_device_get_action(device.get()));
- if (action == kUdevActionAdd)
- FOR_EACH_OBSERVER(Observer, observers_, OnDeviceAdded(device.get()));
- else if (action == kUdevActionRemove)
- FOR_EACH_OBSERVER(Observer, observers_, OnDeviceRemoved(device.get()));
+ if (action == kUdevActionAdd) {
+ for (auto& observer : observers_)
+ observer.OnDeviceAdded(device.get());
+ } else if (action == kUdevActionRemove) {
+ for (auto& observer : observers_)
+ observer.OnDeviceRemoved(device.get());
+ }
}
} // namespace device
« no previous file with comments | « device/base/device_monitor_linux.h ('k') | device/base/device_monitor_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698