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

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

Issue 746213002: Remove implicit conversions from scoped_refptr to T* in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « components/component_updater/background_downloader_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "components/storage_monitor/volume_mount_watcher_win.h" 5 #include "components/storage_monitor/volume_mount_watcher_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <dbt.h> 9 #include <dbt.h>
10 #include <fileapi.h> 10 #include <fileapi.h>
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // a) Enumerate attached devices 353 // a) Enumerate attached devices
354 // b) Create weak pointers for which to send completion signals from 354 // b) Create weak pointers for which to send completion signals from
355 // c) Retrieve metadata on the volumes and then 355 // c) Retrieve metadata on the volumes and then
356 // d) Notify that metadata to listeners. 356 // d) Notify that metadata to listeners.
357 void VolumeMountWatcherWin::Init() { 357 void VolumeMountWatcherWin::Init() {
358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
359 359
360 // When VolumeMountWatcherWin is created, the message pumps are not running 360 // When VolumeMountWatcherWin is created, the message pumps are not running
361 // so a posted task from the constructor would never run. Therefore, do all 361 // so a posted task from the constructor would never run. Therefore, do all
362 // the initializations here. 362 // the initializations here.
363 base::PostTaskAndReplyWithResult(task_runner_, FROM_HERE, 363 base::PostTaskAndReplyWithResult(
364 GetAttachedDevicesCallback(), 364 task_runner_.get(), FROM_HERE, GetAttachedDevicesCallback(),
365 base::Bind(&VolumeMountWatcherWin::AddDevicesOnUIThread, 365 base::Bind(&VolumeMountWatcherWin::AddDevicesOnUIThread,
366 weak_factory_.GetWeakPtr())); 366 weak_factory_.GetWeakPtr()));
367 } 367 }
368 368
369 void VolumeMountWatcherWin::AddDevicesOnUIThread( 369 void VolumeMountWatcherWin::AddDevicesOnUIThread(
370 std::vector<base::FilePath> removable_devices) { 370 std::vector<base::FilePath> removable_devices) {
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
372 372
373 for (size_t i = 0; i < removable_devices.size(); i++) { 373 for (size_t i = 0; i < removable_devices.size(); i++) {
374 if (ContainsKey(pending_device_checks_, removable_devices[i])) 374 if (ContainsKey(pending_device_checks_, removable_devices[i]))
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 callback.Run(StorageMonitor::EJECT_FAILURE); 547 callback.Run(StorageMonitor::EJECT_FAILURE);
548 return; 548 return;
549 } 549 }
550 550
551 task_runner_->PostTask( 551 task_runner_->PostTask(
552 FROM_HERE, 552 FROM_HERE,
553 base::Bind(&EjectDeviceInThreadPool, device, callback, task_runner_, 0)); 553 base::Bind(&EjectDeviceInThreadPool, device, callback, task_runner_, 0));
554 } 554 }
555 555
556 } // namespace storage_monitor 556 } // namespace storage_monitor
OLDNEW
« no previous file with comments | « components/component_updater/background_downloader_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698