blink/bindings: Use PartitionAlloc for compressing strings.

ParkableString compression allocates a temporary buffer inside GzipCompress
using UncheckedMalloc(). From a finch experiment (see bug), there is a
statistically significant increase in malloc() footprint on Android, even though
the only allocations are temporary.
To mitigate the regression, use PartitionAlloc to allocate the temporary data.

This changes:
- compression_utils.cc: take an external output buffer for compression.
- parkable_string.cc: Allocate the temporary buffer with PartitionAlloc, on the
  buffer partition.

Bug: 920194
Change-Id: I57c42f67ea0b09e1ae9137beade4dd0d3c6ef258
Reviewed-on: https://chromium-review.googlesource.com/c/1404083
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Benoit L <lizeb@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#621954}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 83ca30af3b48d17cbd19267f6f76f2d6609084fa
2 files changed