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:
- take an external output buffer for compression.
- Allocate the temporary buffer with PartitionAlloc, on the
  buffer partition.

Bug: 920194
Change-Id: I57c42f67ea0b09e1ae9137beade4dd0d3c6ef258
Reviewed-by: Alexei Svitkine <>
Reviewed-by: Benoit L <>
Reviewed-by: Kentaro Hara <>
Commit-Queue: Benoit L <>
Cr-Original-Commit-Position: refs/heads/master@{#621954}
Cr-Mirrored-Commit: 83ca30af3b48d17cbd19267f6f76f2d6609084fa
2 files changed