update_engine: Split delta_diff_generator file.
The DeltaDiffGenerator class includes both an OperationsGenerator using the
A-to-B operations and a set of common methods used also by the inplace generator.
The delta_diff_generator.{h,cc} files also include a single function to generate
the payload (GenerateUpdatePayloadFile) that centralizes the logic of generating
the operations and writing the payload.
This patch splits these three parts in different files. The common delta diff
function are moved to the delta_diff_utils.{h,cc} files. The operations generator
class that uses A-to-B operations is now in a new ab_generator.{h,cc} pair of files
that implement the ABGenerator() class. Finally, the payload file writing methods
are now in a single PayloadFile class.
This allow us to create payload files without the need to generate images and
their deltas. This will be used in a follow up CL to remove the image generation
logic from the unittests.
BUG=chromium:351589
TEST=Ran unittests. Regenerate a payload with and without this patch; got the same results.
Change-Id: I6816d2c805ba8c0c5c9423c720131a100a15ebaa
Reviewed-on: https://chromium-review.googlesource.com/280838
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/update_engine.gyp b/update_engine.gyp
index e9e5a63..9294f66 100644
--- a/update_engine.gyp
+++ b/update_engine.gyp
@@ -266,9 +266,11 @@
],
},
'sources': [
+ 'payload_generator/ab_generator.cc',
'payload_generator/annotated_operation.cc',
'payload_generator/cycle_breaker.cc',
'payload_generator/delta_diff_generator.cc',
+ 'payload_generator/delta_diff_utils.cc',
'payload_generator/ext2_filesystem.cc',
'payload_generator/extent_ranges.cc',
'payload_generator/extent_utils.cc',
@@ -276,6 +278,7 @@
'payload_generator/graph_types.cc',
'payload_generator/graph_utils.cc',
'payload_generator/inplace_generator.cc',
+ 'payload_generator/payload_file.cc',
'payload_generator/payload_generation_config.cc',
'payload_generator/payload_signer.cc',
'payload_generator/raw_filesystem.cc',
@@ -380,8 +383,9 @@
'omaha_request_params_unittest.cc',
'omaha_response_handler_action_unittest.cc',
'p2p_manager_unittest.cc',
+ 'payload_generator/ab_generator_unittest.cc',
'payload_generator/cycle_breaker_unittest.cc',
- 'payload_generator/delta_diff_generator_unittest.cc',
+ 'payload_generator/delta_diff_utils_unittest.cc',
'payload_generator/ext2_filesystem_unittest.cc',
'payload_generator/extent_ranges_unittest.cc',
'payload_generator/extent_utils_unittest.cc',
@@ -390,6 +394,7 @@
'payload_generator/graph_utils_unittest.cc',
'payload_generator/inplace_generator_unittest.cc',
'payload_generator/payload_signer_unittest.cc',
+ 'payload_generator/payload_file_unittest.cc',
'payload_generator/tarjan_unittest.cc',
'payload_generator/topological_sort_unittest.cc',
'payload_generator/verity_utils_unittest.cc',