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 <stdint.h> | 10 #include <stdint.h> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 BrowserThread::FILE, FROM_HERE, | 261 BrowserThread::FILE, FROM_HERE, |
262 base::Bind(&CreateMtabWatcherLinuxOnFileThread, | 262 base::Bind(&CreateMtabWatcherLinuxOnFileThread, |
263 mtab_path_, | 263 mtab_path_, |
264 weak_ptr_factory_.GetWeakPtr()), | 264 weak_ptr_factory_.GetWeakPtr()), |
265 base::Bind(&StorageMonitorLinux::OnMtabWatcherCreated, | 265 base::Bind(&StorageMonitorLinux::OnMtabWatcherCreated, |
266 weak_ptr_factory_.GetWeakPtr())); | 266 weak_ptr_factory_.GetWeakPtr())); |
267 | 267 |
268 if (!media_transfer_protocol_manager_) { | 268 if (!media_transfer_protocol_manager_) { |
269 media_transfer_protocol_manager_.reset( | 269 media_transfer_protocol_manager_.reset( |
270 device::MediaTransferProtocolManager::Initialize( | 270 device::MediaTransferProtocolManager::Initialize( |
271 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 271 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE))); |
272 } | 272 } |
273 | 273 |
274 media_transfer_protocol_device_observer_.reset( | 274 media_transfer_protocol_device_observer_.reset( |
275 new MediaTransferProtocolDeviceObserverLinux( | 275 new MediaTransferProtocolDeviceObserverLinux( |
276 receiver(), media_transfer_protocol_manager_.get())); | 276 receiver(), media_transfer_protocol_manager_.get())); |
277 } | 277 } |
278 | 278 |
279 bool StorageMonitorLinux::GetStorageInfoForPath( | 279 bool StorageMonitorLinux::GetStorageInfoForPath( |
280 const base::FilePath& path, | 280 const base::FilePath& path, |
281 StorageInfo* device_info) const { | 281 StorageInfo* device_info) const { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 mount_priority_map_[mount_device][mount_point] = removable; | 504 mount_priority_map_[mount_device][mount_point] = removable; |
505 receiver()->ProcessAttach(*storage_info); | 505 receiver()->ProcessAttach(*storage_info); |
506 } | 506 } |
507 | 507 |
508 StorageMonitor* StorageMonitor::CreateInternal() { | 508 StorageMonitor* StorageMonitor::CreateInternal() { |
509 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 509 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
510 return new StorageMonitorLinux(kDefaultMtabPath); | 510 return new StorageMonitorLinux(kDefaultMtabPath); |
511 } | 511 } |
512 | 512 |
513 } // namespace storage_monitor | 513 } // namespace storage_monitor |
OLD | NEW |