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

Unified Diff: courgette/disassembler_elf_32.cc

Issue 1969543002: Unified usage of vector<unique_ptr<T>> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: courgette/disassembler_elf_32.cc
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index 6285c3878170f4c2f7371b43282432b8fde688da..d5f39b485dbdab3668764e0c15744d7325752437 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -273,8 +273,8 @@ CheckBool DisassemblerElf32::RVAsToFileOffsets(
}
CheckBool DisassemblerElf32::RVAsToFileOffsets(
- ScopedVector<TypedRVA>* typed_rvas) {
- for (TypedRVA* typed_rva : *typed_rvas) {
+ std::vector<std::unique_ptr<TypedRVA>>* typed_rvas) {
+ for (auto& typed_rva : *typed_rvas) {
FileOffset file_offset = RVAToFileOffset(typed_rva->rva());
if (file_offset == kNoFileOffset)
return false;
@@ -305,8 +305,8 @@ CheckBool DisassemblerElf32::ParseFile(AssemblyProgram* program) {
std::vector<FileOffset>::iterator current_abs_offset = abs_offsets.begin();
std::vector<FileOffset>::iterator end_abs_offset = abs_offsets.end();
- ScopedVector<TypedRVA>::iterator current_rel = rel32_locations_.begin();
- ScopedVector<TypedRVA>::iterator end_rel = rel32_locations_.end();
+ auto current_rel = rel32_locations_.begin();
huangs 2016/05/11 04:49:23 More consistent to keep at std::vector<std::uniqe_
etiennep 2016/05/11 18:19:12 Done.
+ auto end_rel = rel32_locations_.end();
// Visit section headers ordered by file offset.
for (Elf32_Half section_id : section_header_file_offset_order_) {
@@ -374,8 +374,8 @@ CheckBool DisassemblerElf32::ParseProgbitsSection(
const Elf32_Shdr* section_header,
std::vector<FileOffset>::iterator* current_abs_offset,
std::vector<FileOffset>::iterator end_abs_offset,
- ScopedVector<TypedRVA>::iterator* current_rel,
- ScopedVector<TypedRVA>::iterator end_rel,
+ std::vector<std::unique_ptr<TypedRVA>>::iterator* current_rel,
+ std::vector<std::unique_ptr<TypedRVA>>::iterator end_rel,
AssemblyProgram* program) {
// Walk all the bytes in the file, whether or not in a section.
FileOffset file_offset = section_header->sh_offset;

Powered by Google App Engine
This is Rietveld 408576698