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