update_engine: Move InstallOperation to the top level.
The InstallOperation message in the protobuf is a nested message
inside the DeltaArchiveManifest message, making all references to
operation types be very long names like
DeltaArchiveManifest_InstallOperation_Type_REPLACE_BZ while most other
messages are not nested in the DeltaArchiveManifest message.
To improve readability and to prepare for future update metadata
changes, this patch moves the InstallOperation message to the top level
and replaces all references to operation types with the new shorter
version like InstallOperation::REPLACE_BZ.
This change only impacts the scope of the generated classes and the
serialized format of the protobuf. This exact same question was
addressed by protobuf maintainers here:
https://groups.google.com/forum/#!topic/protobuf/azWAPa6hP4A
Finally coding style and indentation was automatically updated due to
the shorter names.
BUG=b:23179128
TEST=Unittest still pass.
Change-Id: I55add54265934cd1fd3e9cb786c5d3f784902d17
Reviewed-on: https://chromium-review.googlesource.com/293504
Trybot-Ready: Alex Deymo <[email protected]>
Tested-by: Alex Deymo <[email protected]>
Reviewed-by: Alex Deymo <[email protected]>
Commit-Queue: Alex Deymo <[email protected]>
diff --git a/payload_generator/annotated_operation.h b/payload_generator/annotated_operation.h
index 2a88bef..e28c0e8 100644
--- a/payload_generator/annotated_operation.h
+++ b/payload_generator/annotated_operation.h
@@ -21,7 +21,7 @@
std::string name;
// The InstallOperation, as defined by the protobuf.
- DeltaArchiveManifest_InstallOperation op;
+ InstallOperation op;
// Writes |blob| to the end of |data_fd|, and updates |data_file_size| to
// match the new size of |data_fd|. It sets the data_offset and data_length
@@ -32,8 +32,7 @@
// For logging purposes.
std::ostream& operator<<(std::ostream& os, const AnnotatedOperation& aop);
-std::string InstallOperationTypeName(
- DeltaArchiveManifest_InstallOperation_Type op_type);
+std::string InstallOperationTypeName(InstallOperation_Type op_type);
} // namespace chromeos_update_engine