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

Unified Diff: courgette/ensemble_apply.cc

Issue 7920004: Start refactoring to reduce executable type knowledge. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix windows compile warning. Created 9 years, 2 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 | « courgette/ensemble.cc ('k') | courgette/ensemble_create.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/ensemble_apply.cc
diff --git a/courgette/ensemble_apply.cc b/courgette/ensemble_apply.cc
index 6efbc405b22953dfa856ec333ec5c11b99f826ba..499ccac54fa32970ff90f1aeadc1e2e078e5406d 100644
--- a/courgette/ensemble_apply.cc
+++ b/courgette/ensemble_apply.cc
@@ -136,13 +136,19 @@ Status EnsemblePatchApplication::ReadInitialParameters(
if (!transformation_parameters->ReadVarint32(&kind))
return C_BAD_ENSEMBLE_HEADER;
- if (kind == CourgettePatchFile::T_COURGETTE_WIN32_X86) {
- TransformationPatcher* patcher =
- new CourgetteWin32X86Patcher(base_region_);
+ TransformationPatcher* patcher = NULL;
+
+ switch (kind)
+ {
+ case CourgettePatchFile::T_COURGETTE_WIN32_X86:
+ patcher = new CourgetteWin32X86Patcher(base_region_);
+ break;
+ }
+
+ if (patcher)
patchers_.push_back(patcher);
- } else {
+ else
return C_BAD_ENSEMBLE_HEADER;
- }
}
for (size_t i = 0; i < patchers_.size(); ++i) {
« no previous file with comments | « courgette/ensemble.cc ('k') | courgette/ensemble_create.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698