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

Remove implicit HANDLE conversions from content.

BUG=416722
R=piman@chromium.org
TBR=cpu@chromium.org (sandbox_win.cc)

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

Cr-Commit-Position: refs/heads/master@{#296603}
parent 833c1fb4
......@@ -49,7 +49,7 @@ HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) {
if (!handle.IsValid())
return INVALID_HANDLE_VALUE;
if (PowerSetRequestFn(handle, type))
if (PowerSetRequestFn(handle.Get(), type))
return handle.Take();
// Something went wrong.
......@@ -76,7 +76,7 @@ void DeletePowerRequest(POWER_REQUEST_TYPE type, HANDLE handle) {
if (!PowerClearRequestFn)
return;
BOOL success = PowerClearRequestFn(request_handle, type);
BOOL success = PowerClearRequestFn(request_handle.Get(), type);
DCHECK(success);
}
......
......@@ -63,7 +63,7 @@ void GetFontFamilies_SlowBlocking(FontFamilyList* font_families) {
memset(&logfont, 0, sizeof(logfont));
logfont.lfCharSet = DEFAULT_CHARSET;
base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL));
::EnumFontFamiliesExW(hdc,
::EnumFontFamiliesExW(hdc.Get(),
&logfont,
(FONTENUMPROCW) & EnumFontFamiliesProc,
(LPARAM)font_families,
......@@ -78,7 +78,7 @@ void GetFontsInFamily_SlowBlocking(const std::string& family,
base::string16 family16 = base::UTF8ToUTF16(family);
memcpy(&logfont.lfFaceName, &family16[0], sizeof(logfont.lfFaceName));
base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL));
::EnumFontFamiliesExW(hdc,
::EnumFontFamiliesExW(hdc.Get(),
&logfont,
(FONTENUMPROCW) & EnumFontsInFamilyProc,
(LPARAM)fonts_in_family,
......
......@@ -124,10 +124,10 @@ int32_t PepperTrueTypeFontWin::Initialize(
// To get the face name, select the font and query for the name. GetObject
// doesn't fill in the name field of the LOGFONT structure.
base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL));
if (hdc) {
base::win::ScopedSelectObject select_object(hdc, font_.Get());
if (hdc.IsValid()) {
base::win::ScopedSelectObject select_object(hdc.Get(), font_.Get());
WCHAR name[LF_FACESIZE];
GetTextFace(hdc, LF_FACESIZE, name);
GetTextFace(hdc.Get(), LF_FACESIZE, name);
desc->family = base::UTF16ToUTF8(name);
}
......@@ -139,15 +139,15 @@ int32_t PepperTrueTypeFontWin::GetTableTags(std::vector<uint32_t>* tags) {
return PP_ERROR_FAILED;
base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL));
if (!hdc)
if (!hdc.IsValid())
return PP_ERROR_FAILED;
base::win::ScopedSelectObject select_object(hdc, font_.Get());
base::win::ScopedSelectObject select_object(hdc.Get(), font_.Get());
// Get the whole font header.
static const DWORD kFontHeaderSize = 12;
uint8_t header_buf[kFontHeaderSize];
if (GetFontData(hdc, 0, 0, header_buf, kFontHeaderSize) == GDI_ERROR)
if (GetFontData(hdc.Get(), 0, 0, header_buf, kFontHeaderSize) == GDI_ERROR)
return PP_ERROR_FAILED;
// The numTables follows a 4 byte scalerType tag. Font data is stored in
......@@ -159,8 +159,8 @@ int32_t PepperTrueTypeFontWin::GetTableTags(std::vector<uint32_t>* tags) {
DWORD directory_size = num_tables * kDirectoryEntrySize;
scoped_ptr<uint8_t[]> directory(new uint8_t[directory_size]);
// Get the table directory entries after the font header.
if (GetFontData(
hdc, 0 /* tag */, kFontHeaderSize, directory.get(), directory_size) ==
if (GetFontData(hdc.Get(), 0 /* tag */, kFontHeaderSize, directory.get(),
directory_size) ==
GDI_ERROR)
return PP_ERROR_FAILED;
......@@ -185,15 +185,15 @@ int32_t PepperTrueTypeFontWin::GetTable(uint32_t table_tag,
return PP_ERROR_FAILED;
base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL));
if (!hdc)
if (!hdc.IsValid())
return PP_ERROR_FAILED;
base::win::ScopedSelectObject select_object(hdc, font_.Get());
base::win::ScopedSelectObject select_object(hdc.Get(), font_.Get());
// Tags are byte swapped on Windows.
table_tag = base::ByteSwap(table_tag);
// Get the size of the font table first.
DWORD table_size = GetFontData(hdc, table_tag, 0, NULL, 0);
DWORD table_size = GetFontData(hdc.Get(), table_tag, 0, NULL, 0);
if (table_size == GDI_ERROR)
return PP_ERROR_FAILED;
......@@ -204,7 +204,7 @@ int32_t PepperTrueTypeFontWin::GetTable(uint32_t table_tag,
if (safe_length == 0) {
table_size = 0;
} else {
table_size = GetFontData(hdc,
table_size = GetFontData(hdc.Get(),
table_tag,
safe_offset,
reinterpret_cast<uint8_t*>(&(*data)[0]),
......
......@@ -481,7 +481,7 @@ BOOL WINAPI DuplicateHandlePatch(HANDLE source_process_handle,
PROCESS_QUERY_INFORMATION,
FALSE, 0));
base::win::ScopedHandle process(temp_handle);
CHECK(::IsProcessInJob(process, NULL, &is_in_job));
CHECK(::IsProcessInJob(process.Get(), NULL, &is_in_job));
}
}
......@@ -497,7 +497,7 @@ BOOL WINAPI DuplicateHandlePatch(HANDLE source_process_handle,
base::win::ScopedHandle handle(temp_handle);
// Callers use CHECK macro to make sure we get the right stack.
CheckDuplicateHandle(handle);
CheckDuplicateHandle(handle.Get());
}
return TRUE;
......@@ -784,7 +784,7 @@ bool BrokerDuplicateHandle(HANDLE source_handle,
target_process_id));
if (target_process.IsValid()) {
return !!::DuplicateHandle(::GetCurrentProcess(), source_handle,
target_process, target_handle,
target_process.Get(), target_handle,
desired_access, FALSE, options);
}
......
......@@ -181,7 +181,7 @@ IPC::PlatformFileForTransit PpapiThread::ShareHandleWithRemote(
#if defined(OS_WIN)
if (peer_handle_.IsValid()) {
DCHECK(is_broker_);
return IPC::GetFileHandleForProcess(handle, peer_handle_,
return IPC::GetFileHandleForProcess(handle, peer_handle_.Get(),
should_close_source);
}
#endif
......
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