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

Side by Side Diff: chrome/browser/storage_monitor/volume_mount_watcher_win.cc

Issue 12647013: Regularize storage monitor creation in Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 8 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 | « chrome/browser/chrome_browser_main_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/storage_monitor/volume_mount_watcher_win.h" 5 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <dbt.h> 8 #include <dbt.h>
9 #include <fileapi.h> 9 #include <fileapi.h>
10 10
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 } 366 }
367 } 367 }
368 368
369 void VolumeMountWatcherWin::SetNotifications( 369 void VolumeMountWatcherWin::SetNotifications(
370 StorageMonitor::Receiver* notifications) { 370 StorageMonitor::Receiver* notifications) {
371 notifications_ = notifications; 371 notifications_ = notifications;
372 } 372 }
373 373
374 VolumeMountWatcherWin::~VolumeMountWatcherWin() { 374 VolumeMountWatcherWin::~VolumeMountWatcherWin() {
375 weak_factory_.InvalidateWeakPtrs(); 375 weak_factory_.InvalidateWeakPtrs();
376 device_info_worker_pool_->Shutdown();
376 } 377 }
377 378
378 void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread( 379 void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread(
379 const base::FilePath& device_path, 380 const base::FilePath& device_path,
380 const MountPointInfo& info) { 381 const MountPointInfo& info) {
381 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 382 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
382 383
383 device_metadata_[device_path.value()] = info; 384 device_metadata_[device_path.value()] = info;
384 385
385 DeviceCheckComplete(device_path); 386 DeviceCheckComplete(device_path);
(...skipping 21 matching lines...) Expand all
407 // If the device isn't type removable (like a CD), it won't be there. 408 // If the device isn't type removable (like a CD), it won't be there.
408 if (device_info == device_metadata_.end()) 409 if (device_info == device_metadata_.end())
409 return; 410 return;
410 411
411 if (notifications_) 412 if (notifications_)
412 notifications_->ProcessDetach(device_info->second.device_id); 413 notifications_->ProcessDetach(device_info->second.device_id);
413 device_metadata_.erase(device_info); 414 device_metadata_.erase(device_info);
414 } 415 }
415 416
416 } // namespace chrome 417 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698