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

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

Issue 573133003: Code re-factor related to WeakPtrFactory in src/component module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « components/storage_monitor/volume_mount_watcher_win.h ('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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 } // namespace 325 } // namespace
326 326
327 const int kWorkerPoolNumThreads = 3; 327 const int kWorkerPoolNumThreads = 3;
328 const char* kWorkerPoolNamePrefix = "DeviceInfoPool"; 328 const char* kWorkerPoolNamePrefix = "DeviceInfoPool";
329 329
330 VolumeMountWatcherWin::VolumeMountWatcherWin() 330 VolumeMountWatcherWin::VolumeMountWatcherWin()
331 : device_info_worker_pool_(new base::SequencedWorkerPool( 331 : device_info_worker_pool_(new base::SequencedWorkerPool(
332 kWorkerPoolNumThreads, kWorkerPoolNamePrefix)), 332 kWorkerPoolNumThreads, kWorkerPoolNamePrefix)),
333 weak_factory_(this), 333 notifications_(NULL),
334 notifications_(NULL) { 334 weak_factory_(this) {
335 task_runner_ = 335 task_runner_ =
336 device_info_worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( 336 device_info_worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior(
337 device_info_worker_pool_->GetSequenceToken(), 337 device_info_worker_pool_->GetSequenceToken(),
338 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 338 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
339 } 339 }
340 340
341 // static 341 // static
342 base::FilePath VolumeMountWatcherWin::DriveNumberToFilePath(int drive_number) { 342 base::FilePath VolumeMountWatcherWin::DriveNumberToFilePath(int drive_number) {
343 if (drive_number < 0 || drive_number > 25) 343 if (drive_number < 0 || drive_number > 25)
344 return base::FilePath(); 344 return base::FilePath();
(...skipping 202 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/storage_monitor/volume_mount_watcher_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698