aboutsummaryrefslogtreecommitdiff
path: root/zucchini_integration.h
diff options
context:
space:
mode:
authorEtienne Pierre-doray <etiennep@chromium.org>2021-10-28 21:16:04 +0000
committerCopybara-Service <copybara-worker@google.com>2021-10-28 14:31:23 -0700
commitb90a947429fdce96b1d684b9a7af9683cb4a13c1 (patch)
tree333e034b74f5ec4cfb1be1600c4d1a061afbb3bc /zucchini_integration.h
parentaff408603b3db5b7974c522db2ad8c5ce2a0f3c1 (diff)
downloadzucchini-b90a947429fdce96b1d684b9a7af9683cb4a13c1.tar.gz
[Zucchini]: Add patch version.
This is a breaking change to zucchini patch format: Zucchini 1.0, see changelog. Add major/minor patch-wide version, and element version. Also add VerifyPatch() API and command line option to verify patch compatibility. Design: go/zucchini-versions Bug: 1231882 Change-Id: I19f1fbe2ee866c23f0814ffe6a912fb72812edbc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3140224 Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org> Cr-Commit-Position: refs/heads/main@{#936096} NOKEYCHECK=True GitOrigin-RevId: 559d77a9741428a48add017d389d104e431e6de7
Diffstat (limited to 'zucchini_integration.h')
-rw-r--r--zucchini_integration.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/zucchini_integration.h b/zucchini_integration.h
index 2ae6091..2b6287b 100644
--- a/zucchini_integration.h
+++ b/zucchini_integration.h
@@ -63,6 +63,16 @@ status::Code Apply(const base::FilePath& old_path,
const base::FilePath& new_path,
bool force_keep = false);
+// Verifies the patch format in |patch_file| and returns
+// Code::kStatusPatchReadError if the patch is malformed or version is
+// unsupported. Since this uses memory mapped files, crashes are expected in
+// case of I/O errors.
+status::Code VerifyPatch(base::File patch_file);
+
+// Alternative VerifyPatch() interface that takes base::FilePath as arguments.
+// Performs proper cleanup in Windows and UNIX if failure occurs.
+status::Code VerifyPatch(const base::FilePath& patch_path);
+
} // namespace zucchini
#endif // COMPONENTS_ZUCCHINI_ZUCCHINI_INTEGRATION_H_