Preallocate memory in ImportantFileWriter

The ImportantFileWriter triggers a serialization of the data to be
written. Before this CL, it relied on an empty string that would grow
bit by bit when the DataSerializer appended content. With this CL we
memorize the previously used memory and preallocate that plus 1kB to
reduce the number of memory allocations needed.

Bug: 1132866
Change-Id: Ie41d28102f493dcb77a9eb0139d8426c86ef4a50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560952
Reviewed-by: Gabriel Charette <[email protected]>
Commit-Queue: Dominic Battré <[email protected]>
Cr-Commit-Position: refs/heads/master@{#831348}
3 files changed