| 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 // StorageMonitorLinux implementation. | 5 // StorageMonitorLinux implementation. |
| 6 | 6 |
| 7 #include "components/storage_monitor/storage_monitor_linux.h" | 7 #include "components/storage_monitor/storage_monitor_linux.h" |
| 8 | 8 |
| 9 #include <mntent.h> | 9 #include <mntent.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| 11 | 11 |
| 12 #include <list> | 12 #include <list> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/process/kill.h" | 17 #include "base/process/kill.h" |
| 18 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
| 19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "components/storage_monitor/media_storage_util.h" | 23 #include "components/storage_monitor/media_storage_util.h" |
| 24 #include "components/storage_monitor/media_transfer_protocol_device_observer_lin
ux.h" | 24 #include "components/storage_monitor/media_transfer_protocol_device_observer_lin
ux.h" |
| 25 #include "components/storage_monitor/removable_device_constants.h" | 25 #include "components/storage_monitor/removable_device_constants.h" |
| 26 #include "components/storage_monitor/storage_info.h" | 26 #include "components/storage_monitor/storage_info.h" |
| 27 #include "components/storage_monitor/udev_util_linux.h" | 27 #include "components/storage_monitor/udev_util_linux.h" |
| 28 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" | 28 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" |
| 29 #include "device/udev_linux/udev.h" | 29 #include "device/udev_linux/scoped_udev.h" |
| 30 | 30 |
| 31 using content::BrowserThread; | 31 using content::BrowserThread; |
| 32 | 32 |
| 33 namespace storage_monitor { | 33 namespace storage_monitor { |
| 34 | 34 |
| 35 typedef MtabWatcherLinux::MountPointDeviceMap MountPointDeviceMap; | 35 typedef MtabWatcherLinux::MountPointDeviceMap MountPointDeviceMap; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 // udev device property constants. | 39 // udev device property constants. |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 mount_priority_map_[mount_device][mount_point] = removable; | 498 mount_priority_map_[mount_device][mount_point] = removable; |
| 499 receiver()->ProcessAttach(*storage_info); | 499 receiver()->ProcessAttach(*storage_info); |
| 500 } | 500 } |
| 501 | 501 |
| 502 StorageMonitor* StorageMonitor::CreateInternal() { | 502 StorageMonitor* StorageMonitor::CreateInternal() { |
| 503 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 503 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
| 504 return new StorageMonitorLinux(kDefaultMtabPath); | 504 return new StorageMonitorLinux(kDefaultMtabPath); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace storage_monitor | 507 } // namespace storage_monitor |
| OLD | NEW |