Chromium Code Reviews| 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> |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 | 256 |
| 257 BrowserThread::PostTaskAndReplyWithResult( | 257 BrowserThread::PostTaskAndReplyWithResult( |
| 258 BrowserThread::FILE, FROM_HERE, | 258 BrowserThread::FILE, FROM_HERE, |
| 259 base::Bind(&CreateMtabWatcherLinuxOnFileThread, | 259 base::Bind(&CreateMtabWatcherLinuxOnFileThread, |
| 260 mtab_path_, | 260 mtab_path_, |
| 261 weak_ptr_factory_.GetWeakPtr()), | 261 weak_ptr_factory_.GetWeakPtr()), |
| 262 base::Bind(&StorageMonitorLinux::OnMtabWatcherCreated, | 262 base::Bind(&StorageMonitorLinux::OnMtabWatcherCreated, |
| 263 weak_ptr_factory_.GetWeakPtr())); | 263 weak_ptr_factory_.GetWeakPtr())); |
| 264 | 264 |
| 265 if (!media_transfer_protocol_manager_) { | 265 if (!media_transfer_protocol_manager_) { |
| 266 scoped_refptr<base::MessageLoopProxy> loop_proxy = | |
| 267 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); | |
| 268 media_transfer_protocol_manager_.reset( | 266 media_transfer_protocol_manager_.reset( |
| 269 device::MediaTransferProtocolManager::Initialize(loop_proxy)); | 267 device::MediaTransferProtocolManager::Initialize( |
| 268 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | |
|
Lei Zhang
2015/05/15 05:03:34
So this returns a MessageLoopProxy. What's the lon
Pranay
2015/05/15 11:14:23
Acknowledged.
| |
| 270 } | 269 } |
| 271 | 270 |
| 272 media_transfer_protocol_device_observer_.reset( | 271 media_transfer_protocol_device_observer_.reset( |
| 273 new MediaTransferProtocolDeviceObserverLinux( | 272 new MediaTransferProtocolDeviceObserverLinux( |
| 274 receiver(), media_transfer_protocol_manager_.get())); | 273 receiver(), media_transfer_protocol_manager_.get())); |
| 275 } | 274 } |
| 276 | 275 |
| 277 bool StorageMonitorLinux::GetStorageInfoForPath( | 276 bool StorageMonitorLinux::GetStorageInfoForPath( |
| 278 const base::FilePath& path, | 277 const base::FilePath& path, |
| 279 StorageInfo* device_info) const { | 278 StorageInfo* device_info) const { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 mount_priority_map_[mount_device][mount_point] = removable; | 500 mount_priority_map_[mount_device][mount_point] = removable; |
| 502 receiver()->ProcessAttach(*storage_info); | 501 receiver()->ProcessAttach(*storage_info); |
| 503 } | 502 } |
| 504 | 503 |
| 505 StorageMonitor* StorageMonitor::CreateInternal() { | 504 StorageMonitor* StorageMonitor::CreateInternal() { |
| 506 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 505 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
| 507 return new StorageMonitorLinux(kDefaultMtabPath); | 506 return new StorageMonitorLinux(kDefaultMtabPath); |
| 508 } | 507 } |
| 509 | 508 |
| 510 } // namespace storage_monitor | 509 } // namespace storage_monitor |
| OLD | NEW |