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

Unified Diff: chrome/app/image_pre_reader_win.cc

Issue 168643002: Convert scoped_ptr_malloc -> scoped_ptr, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « base/task_runner_util_unittest.cc ('k') | chrome/browser/chromeos/system/timezone_util.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 16d3a1a85f8fbb4b8d513bb02d3608410ba64405..68366695179519b1abf340f9baf89d4ddc01e917 100644
--- a/chrome/app/image_pre_reader_win.cc
+++ b/chrome/app/image_pre_reader_win.cc
@@ -35,7 +35,7 @@ void StaticAssertions() {
// This struct provides a deallocation functor for use with scoped_ptr<T>
// allocated with ::VirtualAlloc().
-struct ScopedPtrVirtualFree {
+struct VirtualFreeDeleter {
void operator() (void* ptr) {
::VirtualFree(ptr, 0, MEM_RELEASE);
}
@@ -252,8 +252,8 @@ bool ImagePreReader::PartialPreReadImageOnDisk(const wchar_t* file_path,
CHECK(pe_image.VerifyMagic());
// Allocate a buffer to hold the pre-read bytes.
- scoped_ptr_malloc<uint8, ScopedPtrVirtualFree> buffer(
- reinterpret_cast<uint8*>(
+ scoped_ptr<uint8, VirtualFreeDeleter> buffer(
+ static_cast<uint8*>(
::VirtualAlloc(NULL, max_chunk_size, MEM_COMMIT, PAGE_READWRITE)));
if (buffer.get() == NULL)
return false;
« no previous file with comments | « base/task_runner_util_unittest.cc ('k') | chrome/browser/chromeos/system/timezone_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698