diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-26 06:20:02 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-26 06:20:02 +0000 |
commit | 1937510f9abd60c7b739709d324996d124bae69b (patch) | |
tree | fde48a7b2b577242d41a0adb82935a4a98e8054f /chrome/installer | |
parent | b639ba5bccc11c388af6738450f7e8b937eca02a (diff) | |
download | chromium_src-1937510f9abd60c7b739709d324996d124bae69b.zip chromium_src-1937510f9abd60c7b739709d324996d124bae69b.tar.gz chromium_src-1937510f9abd60c7b739709d324996d124bae69b.tar.bz2 |
Don't bind a temporary to a reference.
THe style guide doesn't allow non-const references either, so also convert the
reference to a pointer while here.
No intended behavior change.
BUG=82385
NOTRY=true
Review URL: https://codereview.chromium.org/352893003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/test/pe_image_resources.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/installer/test/pe_image_resources.cc b/chrome/installer/test/pe_image_resources.cc index 3b39b69..365e966 100644 --- a/chrome/installer/test/pe_image_resources.cc +++ b/chrome/installer/test/pe_image_resources.cc @@ -27,7 +27,7 @@ bool StructureAt(const uint8* data, size_t data_size, const T** structure) { // static bool EnumResourcesWorker( const base::win::PEImage& image, const uint8* tree_base, DWORD tree_size, - DWORD directory_offset, upgrade_test::EntryPath &path, + DWORD directory_offset, upgrade_test::EntryPath* path, upgrade_test::EnumResource_Fn callback, uintptr_t context) { bool success = true; const IMAGE_RESOURCE_DIRECTORY* resource_directory; @@ -69,11 +69,11 @@ bool EnumResourcesWorker( success = false; break; } - path.push_back( + path->push_back( upgrade_test::EntryId(std::wstring(&dir_string->NameString[0], dir_string->Length))); } else { - path.push_back(upgrade_test::EntryId(scan->Id)); + path->push_back(upgrade_test::EntryId(scan->Id)); } if (scan->DataIsDirectory) { success = EnumResourcesWorker(image, tree_base, tree_size, @@ -88,7 +88,7 @@ bool EnumResourcesWorker( tree_base + tree_size) { // Despite what winnt.h says, OffsetToData is an RVA. callback( - path, + *path, reinterpret_cast<uint8*>(image.RVAToAddr(data_entry->OffsetToData)), data_entry->Size, data_entry->CodePage, context); } else { @@ -96,7 +96,7 @@ bool EnumResourcesWorker( success = false; } } - path.pop_back(); + path->pop_back(); } return success; @@ -112,11 +112,12 @@ bool EnumResources(const base::win::PEImage& image, EnumResource_Fn callback, DWORD resources_size = image.GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_RESOURCE); if (resources_size != 0) { + EntryPath path_storage; return EnumResourcesWorker( image, reinterpret_cast<uint8*>( image.GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_RESOURCE)), - resources_size, 0, EntryPath(), callback, context); + resources_size, 0, &path_storage, callback, context); } return true; } |