Commit c94f1fb7 authored by rvargas's avatar rvargas Committed by Commit bot

Remove implicit HANDLE conversions from components.

BUG=416722
R=jochen@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/596153003

Cr-Commit-Position: refs/heads/master@{#297312}
parent 94dbb777
......@@ -60,7 +60,7 @@ std::string MachineIdProvider::GetMachineId() {
// Perform an initial query to get the number of bytes being returned.
DWORD bytes_returned;
STORAGE_DESCRIPTOR_HEADER header = {};
BOOL status = DeviceIoControl(drive_handle,
BOOL status = DeviceIoControl(drive_handle.Get(),
IOCTL_STORAGE_QUERY_PROPERTY,
&query,
sizeof(STORAGE_PROPERTY_QUERY),
......@@ -74,7 +74,7 @@ std::string MachineIdProvider::GetMachineId() {
// Query for the actual serial number.
std::vector<int8> output_buf(header.Size);
status = DeviceIoControl(drive_handle,
status = DeviceIoControl(drive_handle.Get(),
IOCTL_STORAGE_QUERY_PROPERTY,
&query,
sizeof(STORAGE_PROPERTY_QUERY),
......
......@@ -1189,7 +1189,8 @@ bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info,
// the 32-bit browser process to run the debug exception handler.
if (RunningOnWOW64()) {
return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler(
weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info);
weak_factory_.GetWeakPtr(), nacl_pid, process_handle.Get(),
info);
} else {
NaClStartDebugExceptionHandlerThread(
process_handle.Take(), info,
......
......@@ -30,7 +30,7 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
// NaClDebugExceptionHandlerRun() receives debug events for the
// process.
bool attached = false;
int pid = GetProcessId(nacl_process_);
int pid = GetProcessId(nacl_process_.Get());
if (pid == 0) {
LOG(ERROR) << "Invalid process handle";
} else {
......@@ -44,7 +44,7 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
if (attached) {
NaClDebugExceptionHandlerRun(
nacl_process_,
nacl_process_.Get(),
reinterpret_cast<const void*>(startup_info_.data()),
startup_info_.size());
}
......
......@@ -253,7 +253,7 @@ void EjectDeviceInThreadPool(
// files on it). If this fails, it means some other process has files
// open on the device. Note that the lock is released when the volume
// handle is closed, and this is done by the ScopedHandle above.
BOOL locked = DeviceIoControl(volume_handle, FSCTL_LOCK_VOLUME,
BOOL locked = DeviceIoControl(volume_handle.Get(), FSCTL_LOCK_VOLUME,
NULL, 0, NULL, 0, &bytes_returned, NULL);
UMA_HISTOGRAM_ENUMERATION("StorageMonitor.EjectWinLock",
LOCK_ATTEMPT, NUM_LOCK_OUTCOMES);
......@@ -283,14 +283,14 @@ void EjectDeviceInThreadPool(
// Unmount the device from the filesystem -- this will remove it from
// the file picker, drive enumerations, etc.
BOOL dismounted = DeviceIoControl(volume_handle, FSCTL_DISMOUNT_VOLUME,
BOOL dismounted = DeviceIoControl(volume_handle.Get(), FSCTL_DISMOUNT_VOLUME,
NULL, 0, NULL, 0, &bytes_returned, NULL);
// Reached if we acquired a lock, but could not dismount. This might
// occur if another process unmounted without locking. Call this OK,
// since the volume is now unreachable.
if (!dismounted) {
DeviceIoControl(volume_handle, FSCTL_UNLOCK_VOLUME,
DeviceIoControl(volume_handle.Get(), FSCTL_UNLOCK_VOLUME,
NULL, 0, NULL, 0, &bytes_returned, NULL);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, StorageMonitor::EJECT_OK));
......@@ -300,7 +300,7 @@ void EjectDeviceInThreadPool(
PREVENT_MEDIA_REMOVAL pmr_buffer;
pmr_buffer.PreventMediaRemoval = FALSE;
// Mark the device as safe to remove.
if (!DeviceIoControl(volume_handle, IOCTL_STORAGE_MEDIA_REMOVAL,
if (!DeviceIoControl(volume_handle.Get(), IOCTL_STORAGE_MEDIA_REMOVAL,
&pmr_buffer, sizeof(PREVENT_MEDIA_REMOVAL),
NULL, 0, &bytes_returned, NULL)) {
BrowserThread::PostTask(
......@@ -310,7 +310,7 @@ void EjectDeviceInThreadPool(
}
// Physically eject or soft-eject the device.
if (!DeviceIoControl(volume_handle, IOCTL_STORAGE_EJECT_MEDIA,
if (!DeviceIoControl(volume_handle.Get(), IOCTL_STORAGE_EJECT_MEDIA,
NULL, 0, NULL, 0, &bytes_returned, NULL)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment