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

Unified Diff: components/storage_monitor/storage_monitor_linux.cc

Issue 674703002: Linux: Dynamically load libudev. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoped_udev
Patch Set: rebase to head, which includes third_party/libudev already Created 6 years, 1 month 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: components/storage_monitor/storage_monitor_linux.cc
diff --git a/components/storage_monitor/storage_monitor_linux.cc b/components/storage_monitor/storage_monitor_linux.cc
index 6b57f5cd6d10029bd6acd9e7cbf79750e05aabdc..9d0b75a48c70a7c18cbfe5d929b527c1fdd5313b 100644
--- a/components/storage_monitor/storage_monitor_linux.cc
+++ b/components/storage_monitor/storage_monitor_linux.cc
@@ -99,7 +99,7 @@ class ScopedGetDeviceInfoResultRecorder {
uint64 GetDeviceStorageSize(const base::FilePath& device_path,
struct udev_device* device) {
// sysfs provides the device size in units of 512-byte blocks.
- const std::string partition_size = udev_device_get_sysattr_value(
+ const std::string partition_size = device::udev_device_get_sysattr_value(
device, kSizeSysAttr);
// Keep track of device size, to see how often this information is
@@ -125,7 +125,7 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
ScopedGetDeviceInfoResultRecorder results_recorder;
- device::ScopedUdevPtr udev_obj(udev_new());
+ device::ScopedUdevPtr udev_obj(device::udev_new());
if (!udev_obj.get())
return storage_info.Pass();
@@ -142,8 +142,8 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
return storage_info.Pass(); // Not a supported type.
device::ScopedUdevDevicePtr device(
- udev_device_new_from_devnum(udev_obj.get(), device_type,
- device_stat.st_rdev));
+ device::udev_device_new_from_devnum(udev_obj.get(), device_type,
+ device_stat.st_rdev));
if (!device.get())
return storage_info.Pass();
@@ -160,15 +160,17 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, volume_label);
const char* value =
- udev_device_get_sysattr_value(device.get(), kRemovableSysAttr);
+ device::udev_device_get_sysattr_value(device.get(), kRemovableSysAttr);
if (!value) {
// |parent_device| is owned by |device| and does not need to be cleaned
// up.
struct udev_device* parent_device =
- udev_device_get_parent_with_subsystem_devtype(device.get(),
- kBlockSubsystemKey,
- kDiskDeviceTypeKey);
- value = udev_device_get_sysattr_value(parent_device, kRemovableSysAttr);
+ device::udev_device_get_parent_with_subsystem_devtype(
+ device.get(),
+ kBlockSubsystemKey,
+ kDiskDeviceTypeKey);
+ value = device::udev_device_get_sysattr_value(parent_device,
+ kRemovableSysAttr);
}
const bool is_removable = (value && atoi(value) == 1);
« no previous file with comments | « chrome/installer/linux/sysroot_scripts/sysroot-creator-wheezy.sh ('k') | components/storage_monitor/udev_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698