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

Side by Side Diff: courgette/patch_generator_x86_32.h

Issue 1027883002: Update out-of-date comments and error messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | courgette/patcher_x86_32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This is the transformation and adjustment for Windows X86 executables. 5 // This is the transformation and adjustment for all executables.
6 // The same code can be used for Windows X64 executables. 6 // The executable type is determined by ParseDetectedExecutable function.
7 7
8 #ifndef COURGETTE_WIN32_X86_GENERATOR_H_ 8 #ifndef COURGETTE_WIN32_X86_GENERATOR_H_
9 #define COURGETTE_WIN32_X86_GENERATOR_H_ 9 #define COURGETTE_WIN32_X86_GENERATOR_H_
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 13
14 #include "courgette/assembly_program.h" 14 #include "courgette/assembly_program.h"
15 #include "courgette/ensemble.h" 15 #include "courgette/ensemble.h"
16 16
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return C_GENERAL_ERROR; 60 return C_GENERAL_ERROR;
61 61
62 // Generate old version of program using |corrected_parameters|. 62 // Generate old version of program using |corrected_parameters|.
63 // TODO(sra): refactor to use same code from patcher_. 63 // TODO(sra): refactor to use same code from patcher_.
64 AssemblyProgram* old_program = NULL; 64 AssemblyProgram* old_program = NULL;
65 Status old_parse_status = 65 Status old_parse_status =
66 ParseDetectedExecutable(old_element_->region().start(), 66 ParseDetectedExecutable(old_element_->region().start(),
67 old_element_->region().length(), 67 old_element_->region().length(),
68 &old_program); 68 &old_program);
69 if (old_parse_status != C_OK) { 69 if (old_parse_status != C_OK) {
70 LOG(ERROR) << "Cannot parse as WinPE " << old_element_->Name(); 70 LOG(ERROR) << "Cannot parse an executable " << old_element_->Name();
71 return old_parse_status; 71 return old_parse_status;
72 } 72 }
73 73
74 AssemblyProgram* new_program = NULL; 74 AssemblyProgram* new_program = NULL;
75 Status new_parse_status = 75 Status new_parse_status =
76 ParseDetectedExecutable(new_element_->region().start(), 76 ParseDetectedExecutable(new_element_->region().start(),
77 new_element_->region().length(), 77 new_element_->region().length(),
78 &new_program); 78 &new_program);
79 if (new_parse_status != C_OK) { 79 if (new_parse_status != C_OK) {
80 DeleteAssemblyProgram(old_program); 80 DeleteAssemblyProgram(old_program);
81 LOG(ERROR) << "Cannot parse as WinPE " << new_element_->Name(); 81 LOG(ERROR) << "Cannot parse an executable " << new_element_->Name();
82 return new_parse_status; 82 return new_parse_status;
83 } 83 }
84 84
85 // Trim labels below a certain threshold 85 // Trim labels below a certain threshold
86 Status trim_old_status = TrimLabels(old_program); 86 Status trim_old_status = TrimLabels(old_program);
87 if (trim_old_status != C_OK) { 87 if (trim_old_status != C_OK) {
88 DeleteAssemblyProgram(old_program); 88 DeleteAssemblyProgram(old_program);
89 return trim_old_status; 89 return trim_old_status;
90 } 90 }
91 91
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 private: 141 private:
142 virtual ~PatchGeneratorX86_32() { } 142 virtual ~PatchGeneratorX86_32() { }
143 143
144 ExecutableType kind_; 144 ExecutableType kind_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(PatchGeneratorX86_32); 146 DISALLOW_COPY_AND_ASSIGN(PatchGeneratorX86_32);
147 }; 147 };
148 148
149 } // namespace courgette 149 } // namespace courgette
150 #endif // COURGETTE_WIN32_X86_GENERATOR_H_ 150 #endif // COURGETTE_WIN32_X86_GENERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | courgette/patcher_x86_32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698