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

Unified Diff: chrome/app/image_pre_reader_win.cc

Issue 606473002: Remove implicit HANDLE conversions from chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove spurious file and fix indent (+rebase) Created 6 years, 3 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 | « no previous file | chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/image_pre_reader_win.cc
diff --git a/chrome/app/image_pre_reader_win.cc b/chrome/app/image_pre_reader_win.cc
index 68366695179519b1abf340f9baf89d4ddc01e917..6c5ef6bcb924e248b39d23d5203cac2d0a261d7e 100644
--- a/chrome/app/image_pre_reader_win.cc
+++ b/chrome/app/image_pre_reader_win.cc
@@ -227,7 +227,7 @@ bool ImagePreReader::PartialPreReadImageOnDisk(const wchar_t* file_path,
headers.reserve(kMinHeaderBufferSize);
// Read, hopefully, all of the headers.
- if (!ReadMissingBytes(file, &headers, kMinHeaderBufferSize))
+ if (!ReadMissingBytes(file.Get(), &headers, kMinHeaderBufferSize))
return false;
// The DOS header starts at offset 0 and allows us to get the offset of the
@@ -235,7 +235,7 @@ bool ImagePreReader::PartialPreReadImageOnDisk(const wchar_t* file_path,
size_t nt_headers_start =
reinterpret_cast<IMAGE_DOS_HEADER*>(&headers[0])->e_lfanew;
size_t nt_headers_end = nt_headers_start + sizeof(IMAGE_NT_HEADERS);
- if (!ReadMissingBytes(file, &headers, nt_headers_end))
+ if (!ReadMissingBytes(file.Get(), &headers, nt_headers_end))
return false;
// Now that we've got the NT headers we can get the total header size,
@@ -243,7 +243,7 @@ bool ImagePreReader::PartialPreReadImageOnDisk(const wchar_t* file_path,
// to capture all of the header data.
size_t size_of_headers = reinterpret_cast<IMAGE_NT_HEADERS*>(
&headers[nt_headers_start])->OptionalHeader.SizeOfHeaders;
- if (!ReadMissingBytes(file, &headers, size_of_headers))
+ if (!ReadMissingBytes(file.Get(), &headers, size_of_headers))
return false;
// Now we have all of the headers. This is enough to let us use the PEImage
@@ -263,9 +263,10 @@ bool ImagePreReader::PartialPreReadImageOnDisk(const wchar_t* file_path,
for (UINT i = 0; (section = pe_image.GetSectionHeader(i)) != NULL; ++i) {
CHECK_LE(reinterpret_cast<const uint8*>(section + 1),
&headers[0] + headers.size());
- if (!ReadThroughSection(
- file, section, percentage, buffer.get(), max_chunk_size))
+ if (!ReadThroughSection(file.Get(), section, percentage, buffer.get(),
+ max_chunk_size)) {
return false;
+ }
}
// We're done.
@@ -357,7 +358,7 @@ bool ImagePreReader::PreReadImage(const wchar_t* file_path,
DWORD len;
size_t total_read = 0;
- while (::ReadFile(file, buffer, actual_step_size, &len, NULL) &&
+ while (::ReadFile(file.Get(), buffer, actual_step_size, &len, NULL) &&
len > 0 &&
(size_to_read ? total_read < size_to_read : true)) {
total_read += static_cast<size_t>(len);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/image_writer_private/removable_storage_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698