OLD | NEW |
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 Windows X86 executables. |
6 | 6 |
7 #ifndef COURGETTE_WIN32_X86_GENERATOR_H_ | 7 #ifndef COURGETTE_WIN32_X86_GENERATOR_H_ |
8 #define COURGETTE_WIN32_X86_GENERATOR_H_ | 8 #define COURGETTE_WIN32_X86_GENERATOR_H_ |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 | 12 |
13 #include "courgette/ensemble.h" | 13 #include "courgette/ensemble.h" |
14 | 14 |
15 namespace courgette { | 15 namespace courgette { |
16 | 16 |
17 class PatchGeneratorX86_32 : public TransformationPatchGenerator { | 17 class PatchGeneratorX86_32 : public TransformationPatchGenerator { |
18 public: | 18 public: |
19 PatchGeneratorX86_32(Element* old_element, | 19 PatchGeneratorX86_32(Element* old_element, |
20 Element* new_element, | 20 Element* new_element, |
21 PatcherX86_32* patcher, | 21 PatcherX86_32* patcher, |
22 ExecutableType kind) | 22 ExecutableType kind) |
23 : TransformationPatchGenerator(old_element, new_element, patcher), | 23 : TransformationPatchGenerator(old_element, new_element, patcher), |
24 kind_(kind) { | 24 kind_(kind) { |
25 } | 25 } |
26 | 26 |
27 virtual ExecutableType Kind() { return kind_; } | 27 virtual ExecutableType Kind() { return kind_; } |
28 | 28 |
29 Status WriteInitialParameters(SinkStream* parameter_stream) { | 29 Status WriteInitialParameters(SinkStream* parameter_stream) { |
30 if (!parameter_stream->WriteSizeVarint32( | 30 if (!parameter_stream->WriteSizeVarint32( |
31 old_element_->offset_in_ensemble()) || | 31 old_element_->offset_in_ensemble()) || |
32 !parameter_stream->WriteSizeVarint32(old_element_->region().length())) { | 32 !parameter_stream->WriteSizeVarint32(old_element_->region().length())) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 private: | 126 private: |
127 virtual ~PatchGeneratorX86_32() { } | 127 virtual ~PatchGeneratorX86_32() { } |
128 | 128 |
129 ExecutableType kind_; | 129 ExecutableType kind_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(PatchGeneratorX86_32); | 131 DISALLOW_COPY_AND_ASSIGN(PatchGeneratorX86_32); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace courgette | 134 } // namespace courgette |
135 #endif // COURGETTE_WIN32_X86_GENERATOR_H_ | 135 #endif // COURGETTE_WIN32_X86_GENERATOR_H_ |
OLD | NEW |