AU: Optionally limit the size of delta update operations.
Add a --chunk_size flag to delta_generator. If it's not -1, files will
be split into chunks of this size when generating delta payloads. This
effectively limits the size of each delta operation.
BUG=chromium:229797
TEST=unit tests; generated delta payloads and checked them through
paycheck.py.
Change-Id: I21502118088bfbac75aa8009eb144f6aaf23a83a
Reviewed-on: https://gerrit.chromium.org/gerrit/48357
Commit-Queue: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/delta_diff_generator_unittest.cc b/delta_diff_generator_unittest.cc
index 349065f..7fa28c3 100644
--- a/delta_diff_generator_unittest.cc
+++ b/delta_diff_generator_unittest.cc
@@ -70,6 +70,8 @@
DeltaArchiveManifest_InstallOperation op;
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
true, // bsdiff_allowed
&data,
&op,
@@ -100,6 +102,8 @@
DeltaArchiveManifest_InstallOperation op;
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
true, // bsdiff_allowed
&data,
&op,
@@ -131,6 +135,8 @@
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
false, // bsdiff_allowed
&data,
&op,
@@ -155,6 +161,8 @@
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
false, // bsdiff_allowed
&data,
&op,
@@ -180,6 +188,8 @@
DeltaArchiveManifest_InstallOperation op;
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
true, // bsdiff_allowed
&data,
&op,
@@ -212,6 +222,8 @@
DeltaArchiveManifest_InstallOperation op;
EXPECT_TRUE(DeltaDiffGenerator::ReadFileToDiff(old_path(),
new_path(),
+ 0, // chunk_offset
+ -1, // chunk_size
true, // bsdiff_allowed
&data,
&op,