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 <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_metadata.proto b/update_metadata.proto
index bf0cb45..b95a040 100644
--- a/update_metadata.proto
+++ b/update_metadata.proto
@@ -110,44 +110,45 @@
   optional string build_version = 6;
 }
 
-message DeltaArchiveManifest {
-  message InstallOperation {
-    enum Type {
-      REPLACE = 0;  // Replace destination extents w/ attached data
-      REPLACE_BZ = 1;  // Replace destination extents w/ attached bzipped data
-      MOVE = 2;  // Move source extents to destination extents
-      BSDIFF = 3;  // The data is a bsdiff binary diff
-      // SOURCE_COPY and SOURCE_BSDIFF are only supported on minor version 2.
-      SOURCE_COPY = 4; // Copy from source to target partition
-      SOURCE_BSDIFF = 5; // Like BSDIFF, but read from source partition
-    }
-    required Type type = 1;
-    // The offset into the delta file (after the protobuf)
-    // where the data (if any) is stored
-    optional uint32 data_offset = 2;
-    // The length of the data in the delta file
-    optional uint32 data_length = 3;
-
-    // Ordered list of extents that are read from (if any) and written to.
-    repeated Extent src_extents = 4;
-    // Byte length of src, equal to the number of blocks in src_extents *
-    // block_size. It is used for BSDIFF, because we need to pass that
-    // external program the number of bytes to read from the blocks we pass it.
-    // This is not used in any other operation.
-    optional uint64 src_length = 5;
-
-    repeated Extent dst_extents = 6;
-    // Byte length of dst, equal to the number of blocks in dst_extents *
-    // block_size. Used for BSDIFF, but not in any other operation.
-    optional uint64 dst_length = 7;
-
-    // Optional SHA 256 hash of the blob associated with this operation.
-    // This is used as a primary validation for http-based downloads and
-    // as a defense-in-depth validation for https-based downloads. If
-    // the operation doesn't refer to any blob, this field will have
-    // zero bytes.
-    optional bytes data_sha256_hash = 8;
+message InstallOperation {
+  enum Type {
+    REPLACE = 0;  // Replace destination extents w/ attached data
+    REPLACE_BZ = 1;  // Replace destination extents w/ attached bzipped data
+    MOVE = 2;  // Move source extents to destination extents
+    BSDIFF = 3;  // The data is a bsdiff binary diff
+    // SOURCE_COPY and SOURCE_BSDIFF are only supported on minor version 2.
+    SOURCE_COPY = 4; // Copy from source to target partition
+    SOURCE_BSDIFF = 5; // Like BSDIFF, but read from source partition
   }
+  required Type type = 1;
+  // The offset into the delta file (after the protobuf)
+  // where the data (if any) is stored
+  optional uint32 data_offset = 2;
+  // The length of the data in the delta file
+  optional uint32 data_length = 3;
+
+  // Ordered list of extents that are read from (if any) and written to.
+  repeated Extent src_extents = 4;
+  // Byte length of src, equal to the number of blocks in src_extents *
+  // block_size. It is used for BSDIFF, because we need to pass that
+  // external program the number of bytes to read from the blocks we pass it.
+  // This is not used in any other operation.
+  optional uint64 src_length = 5;
+
+  repeated Extent dst_extents = 6;
+  // Byte length of dst, equal to the number of blocks in dst_extents *
+  // block_size. Used for BSDIFF, but not in any other operation.
+  optional uint64 dst_length = 7;
+
+  // Optional SHA 256 hash of the blob associated with this operation.
+  // This is used as a primary validation for http-based downloads and
+  // as a defense-in-depth validation for https-based downloads. If
+  // the operation doesn't refer to any blob, this field will have
+  // zero bytes.
+  optional bytes data_sha256_hash = 8;
+}
+
+message DeltaArchiveManifest {
   repeated InstallOperation install_operations = 1;
   repeated InstallOperation kernel_install_operations = 2;