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

Side by Side Diff: components/storage_monitor/storage_monitor_linux.cc

Issue 1126963003: [components/storage_monitor] Use ThreadTaskRunnerHandle instead of LoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments 2 Created 5 years, 7 months 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/storage_monitor/storage_monitor_chromeos.cc ('k') | components/storage_monitor/storage_monitor_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698