| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/udev_linux/udev0_loader.h" | 5 #include "device/udev_linux/udev0_loader.h" |
| 6 | 6 |
| 7 #include "library_loaders/libudev0.h" | 7 #include "library_loaders/libudev0.h" |
| 8 | 8 |
| 9 namespace device { | 9 namespace device { |
| 10 | 10 |
| 11 Udev0Loader::Udev0Loader() { | 11 Udev0Loader::Udev0Loader() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 Udev0Loader::~Udev0Loader() { | 14 Udev0Loader::~Udev0Loader() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 bool Udev0Loader::Init() { | 17 bool Udev0Loader::Init() { |
| 18 if (lib_loader_) | 18 if (lib_loader_) |
| 19 return lib_loader_->loaded(); | 19 return lib_loader_->loaded(); |
| 20 lib_loader_.reset(new LibUdev0Loader); | 20 lib_loader_.reset(new LibUdev0Loader); |
| 21 #if defined(MEMORY_SANITIZER) |
| 22 // Temporary hack: rely on the symlink to pick up whichever *instrumented* |
| 23 // version of libudev we have, be it libudev0 or libudev1. crbug.com/437464 |
| 24 // TODO(earthdok): Remove this hack after upgrading our LKGR builders. |
| 25 return lib_loader_->Load("libudev.so"); |
| 26 #else |
| 21 return lib_loader_->Load("libudev.so.0"); | 27 return lib_loader_->Load("libudev.so.0"); |
| 28 #endif |
| 22 } | 29 } |
| 23 | 30 |
| 24 const char* Udev0Loader::udev_device_get_action(udev_device* udev_device) { | 31 const char* Udev0Loader::udev_device_get_action(udev_device* udev_device) { |
| 25 return lib_loader_->udev_device_get_action(udev_device); | 32 return lib_loader_->udev_device_get_action(udev_device); |
| 26 } | 33 } |
| 27 | 34 |
| 28 const char* Udev0Loader::udev_device_get_devnode(udev_device* udev_device) { | 35 const char* Udev0Loader::udev_device_get_devnode(udev_device* udev_device) { |
| 29 return lib_loader_->udev_device_get_devnode(udev_device); | 36 return lib_loader_->udev_device_get_devnode(udev_device); |
| 30 } | 37 } |
| 31 | 38 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 163 |
| 157 void Udev0Loader::udev_set_log_priority(struct udev* udev, int priority) { | 164 void Udev0Loader::udev_set_log_priority(struct udev* udev, int priority) { |
| 158 return lib_loader_->udev_set_log_priority(udev, priority); | 165 return lib_loader_->udev_set_log_priority(udev, priority); |
| 159 } | 166 } |
| 160 | 167 |
| 161 void Udev0Loader::udev_unref(udev* udev) { | 168 void Udev0Loader::udev_unref(udev* udev) { |
| 162 lib_loader_->udev_unref(udev); | 169 lib_loader_->udev_unref(udev); |
| 163 } | 170 } |
| 164 | 171 |
| 165 } // namespace device | 172 } // namespace device |
| OLD | NEW |