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

Side by Side Diff: courgette/ensemble.h

Issue 6546008: Improved memory usage while applying patch.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // The main idea in Courgette is to do patching *under a tranformation*. The 5 // The main idea in Courgette is to do patching *under a tranformation*. The
6 // input is transformed into a new representation, patching occurs in the new 6 // input is transformed into a new representation, patching occurs in the new
7 // repesentation, and then the tranform is reversed to get the patched data. 7 // repesentation, and then the tranform is reversed to get the patched data.
8 // 8 //
9 // The idea is applied to pieces (or 'Elements') of the whole (or 'Ensemble'). 9 // The idea is applied to pieces (or 'Elements') of the whole (or 'Ensemble').
10 // Each of the elements has to go through the same set of steps in lock-step, 10 // Each of the elements has to go through the same set of steps in lock-step,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 struct CourgettePatchFile { 101 struct CourgettePatchFile {
102 // 102 //
103 // The Courgette patch format interleaves the data for N embedded Elements. 103 // The Courgette patch format interleaves the data for N embedded Elements.
104 // 104 //
105 // Format of a patch file: 105 // Format of a patch file:
106 // header: 106 // header:
107 // magic 107 // magic
108 // version 108 // version
109 // source-checksum 109 // source-checksum
110 // target-checksum 110 // target-checksum
111 // final-patch-input-size (an allocation hint)
111 // multiple-streams: 112 // multiple-streams:
112 // stream 0: 113 // stream 0:
113 // number-of-transformed-elements (N) - varint32 114 // number-of-transformed-elements (N) - varint32
114 // transformation-1-method-id 115 // transformation-1-method-id
115 // transformation-2-method-id 116 // transformation-2-method-id
116 // ... 117 // ...
117 // transformation-1-initial-parameters 118 // transformation-1-initial-parameters
118 // transformation-2-initial-parameters 119 // transformation-2-initial-parameters
119 // ... 120 // ...
120 // stream 1: 121 // stream 1:
121 // correction: 122 // correction:
122 // transformation-1-parameters 123 // transformation-1-parameters
123 // transformation-2-parameters 124 // transformation-2-parameters
124 // ... 125 // ...
125 // stream 2: 126 // stream 2:
126 // correction: 127 // correction:
127 // transformed-element-1 128 // transformed-element-1
128 // transformed-element-2 129 // transformed-element-2
129 // ... 130 // ...
130 // stream 3: 131 // stream 3:
131 // correction: 132 // correction:
132 // base-file 133 // base-file
133 // element-1 134 // element-1
134 // element-2 135 // element-2
135 // ... 136 // ...
136 137
137 static const uint32 kMagic = 'C' | ('o' << 8) | ('u' << 16); 138 static const uint32 kMagic = 'C' | ('o' << 8) | ('u' << 16);
138 139
139 static const uint32 kVersion = 20090320; 140 static const uint32 kVersion = 20110216;
140 141
141 // Transformation method IDs. 142 // Transformation method IDs.
142 enum TransformationMethodId { 143 enum TransformationMethodId {
143 T_COURGETTE_WIN32_X86 = 1, // Windows 32 bit 'Portable Executable' x86. 144 T_COURGETTE_WIN32_X86 = 1, // Windows 32 bit 'Portable Executable' x86.
144 }; 145 };
145 }; 146 };
146 147
147 // For any transform you would implement both a TransformationPatcher and a 148 // For any transform you would implement both a TransformationPatcher and a
148 // TransformationPatchGenerator. 149 // TransformationPatchGenerator.
149 // 150 //
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 SinkStream* reformed_element); 249 SinkStream* reformed_element);
249 250
250 protected: 251 protected:
251 Element* old_element_; 252 Element* old_element_;
252 Element* new_element_; 253 Element* new_element_;
253 TransformationPatcher* patcher_; 254 TransformationPatcher* patcher_;
254 }; 255 };
255 256
256 } // namespace 257 } // namespace
257 #endif // COURGETTE_ENSEMBLE_H_ 258 #endif // COURGETTE_ENSEMBLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698