AU: improve abstraction of DeltaPerformer.ParsePayloadMetadata()
This method used to take a manifest object pointer to be filled in.
However, since the class it belongs to has a private member for this
purpose, it makes little sense to pass a pointer to a member (and not
use this member directly in the parsing method). This was likely done to
allow shortcuts when other logic needed to parse metadata, such as the
PayloadSigner. Instead, ParsePayloadMetadata() now populates its
object's manifest, and we provide a method for copying the content of
a parsed manifest for use by external entities.
Note that we still require to pass in a buffer (vector) with the payload
data to be parsed, instead of parsing the object's own buffer_ member.
This feels like a reasonable compromise, meant to facilitate direct use
of the parsing logic (PayloadSigner, unit tests).
Also exposes (and fixes) a hidden dependency on an internal member when
discarding download buffer content. Minor cosmetic fixes (indentation
etc).
BUG=chromium:229726
TEST=Unit tests
TEST=Updated an x86-alex via image_to_live.
Change-Id: Ic0a9c830986981eb02a553f924e18767a69c3082
Reviewed-on: https://chromium-review.googlesource.com/183715
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
4 files changed