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

Unified Diff: components/storage_monitor/volume_mount_watcher_win.cc

Issue 1004933003: favor DCHECK_CURRENTLY_ON for better logs in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/storage_monitor/storage_monitor_linux.cc ('k') | components/wallpaper/wallpaper_manager_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/storage_monitor/volume_mount_watcher_win.cc
diff --git a/components/storage_monitor/volume_mount_watcher_win.cc b/components/storage_monitor/volume_mount_watcher_win.cc
index 6a89e1a1e01e4800f41208533eecfe85d2430e2a..bdc7634c39c8925ebaba6966ba30aa7a320c7a7f 100644
--- a/components/storage_monitor/volume_mount_watcher_win.cc
+++ b/components/storage_monitor/volume_mount_watcher_win.cc
@@ -351,7 +351,7 @@ base::FilePath VolumeMountWatcherWin::DriveNumberToFilePath(int drive_number) {
// c) Retrieve metadata on the volumes and then
// d) Notify that metadata to listeners.
void VolumeMountWatcherWin::Init() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// When VolumeMountWatcherWin is created, the message pumps are not running
// so a posted task from the constructor would never run. Therefore, do all
@@ -364,7 +364,7 @@ void VolumeMountWatcherWin::Init() {
void VolumeMountWatcherWin::AddDevicesOnUIThread(
std::vector<base::FilePath> removable_devices) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (size_t i = 0; i < removable_devices.size(); i++) {
if (ContainsKey(pending_device_checks_, removable_devices[i]))
@@ -400,7 +400,7 @@ void VolumeMountWatcherWin::RetrieveInfoForDeviceAndAdd(
void VolumeMountWatcherWin::DeviceCheckComplete(
const base::FilePath& device_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
pending_device_checks_.erase(device_path);
if (pending_device_checks_.size() == 0) {
@@ -421,7 +421,7 @@ VolumeMountWatcherWin::GetDeviceDetailsCallbackType
bool VolumeMountWatcherWin::GetDeviceInfo(const base::FilePath& device_path,
StorageInfo* info) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(info);
base::FilePath path(device_path);
MountPointDeviceMetadataMap::const_iterator iter =
@@ -439,7 +439,7 @@ bool VolumeMountWatcherWin::GetDeviceInfo(const base::FilePath& device_path,
}
void VolumeMountWatcherWin::OnWindowMessage(UINT event_type, LPARAM data) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
switch (event_type) {
case DBT_DEVICEARRIVAL: {
if (IsLogicalVolumeStructure(data)) {
@@ -504,7 +504,7 @@ VolumeMountWatcherWin::~VolumeMountWatcherWin() {
void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread(
const base::FilePath& device_path,
const StorageInfo& info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
device_metadata_[device_path] = info;
@@ -516,7 +516,7 @@ void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread(
void VolumeMountWatcherWin::HandleDeviceDetachEventOnUIThread(
const base::string16& device_location) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
MountPointDeviceMetadataMap::const_iterator device_info =
device_metadata_.find(base::FilePath(device_location));
@@ -532,7 +532,7 @@ void VolumeMountWatcherWin::HandleDeviceDetachEventOnUIThread(
void VolumeMountWatcherWin::EjectDevice(
const std::string& device_id,
base::Callback<void(StorageMonitor::EjectStatus)> callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::FilePath device = MediaStorageUtil::FindDevicePathById(device_id);
if (device.empty()) {
callback.Run(StorageMonitor::EJECT_FAILURE);
« no previous file with comments | « components/storage_monitor/storage_monitor_linux.cc ('k') | components/wallpaper/wallpaper_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698