diff options
author | dnicoara <dnicoara@chromium.org> | 2014-09-25 19:52:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-26 02:52:57 +0000 |
commit | 385034b44fb4f96b0258048955a927cc6f1c0cfd (patch) | |
tree | 227fe86241b3ce375ba5925c05b6aac8c7245207 /device | |
parent | 5c2c85e1bec2982da68fc8c902b56882f479c8f2 (diff) | |
download | chromium_src-385034b44fb4f96b0258048955a927cc6f1c0cfd.zip chromium_src-385034b44fb4f96b0258048955a927cc6f1c0cfd.tar.gz chromium_src-385034b44fb4f96b0258048955a927cc6f1c0cfd.tar.bz2 |
Use USE_UDEV instead of OS_LINUX when trying to use Udev functionality
Fixes the Ozone builder where udev isn't available.
BUG=none
Review URL: https://codereview.chromium.org/604143002
Cr-Commit-Position: refs/heads/master@{#296866}
Diffstat (limited to 'device')
-rw-r--r-- | device/usb/usb_device_impl.cc | 12 | ||||
-rw-r--r-- | device/usb/usb_device_impl.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/device/usb/usb_device_impl.cc b/device/usb/usb_device_impl.cc index cd29e1c..b1beeb2 100644 --- a/device/usb/usb_device_impl.cc +++ b/device/usb/usb_device_impl.cc @@ -25,9 +25,9 @@ #include "chromeos/dbus/permission_broker_client.h" #endif // defined(OS_CHROMEOS) -#if defined(OS_LINUX) +#if defined(USE_UDEV) #include "device/udev_linux/udev.h" -#endif // defined(OS_LINUX) +#endif // defined(USE_UDEV) namespace device { @@ -130,7 +130,7 @@ UsbDeviceImpl::UsbDeviceImpl( CHECK(platform_device) << "platform_device cannot be NULL"; libusb_ref_device(platform_device); -#if defined(OS_LINUX) +#if defined(USE_UDEV) ScopedUdevPtr udev(udev_new()); ScopedUdevEnumeratePtr enumerate(udev_enumerate_new(udev.get())); @@ -322,7 +322,7 @@ const UsbConfigDescriptor& UsbDeviceImpl::GetConfiguration() { bool UsbDeviceImpl::GetManufacturer(base::string16* manufacturer) { DCHECK(thread_checker_.CalledOnValidThread()); -#if defined(OS_LINUX) +#if defined(USE_UDEV) if (manufacturer_.empty()) { return false; } @@ -353,7 +353,7 @@ bool UsbDeviceImpl::GetManufacturer(base::string16* manufacturer) { bool UsbDeviceImpl::GetProduct(base::string16* product) { DCHECK(thread_checker_.CalledOnValidThread()); -#if defined(OS_LINUX) +#if defined(USE_UDEV) if (product_.empty()) { return false; } @@ -384,7 +384,7 @@ bool UsbDeviceImpl::GetProduct(base::string16* product) { bool UsbDeviceImpl::GetSerialNumber(base::string16* serial_number) { DCHECK(thread_checker_.CalledOnValidThread()); -#if defined(OS_LINUX) +#if defined(USE_UDEV) if (serial_number_.empty()) { return false; } diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h index f0d22b2..5f5228b 100644 --- a/device/usb/usb_device_impl.h +++ b/device/usb/usb_device_impl.h @@ -63,7 +63,7 @@ class UsbDeviceImpl : public UsbDevice { base::ThreadChecker thread_checker_; PlatformUsbDevice platform_device_; -#if defined(OS_LINUX) +#if defined(USE_UDEV) // On Linux these properties are read from sysfs when the device is enumerated // to avoid hitting the permission broker on Chrome OS for a real string // descriptor request. |