Allow GZIP compression of remote-bound WebRTC event logs

Compress remote-bound WebRTC event logs while writing them to disk.
* Logs for which the file size budget did not allow covering the
  entire call, can now get more coverage.
* Short calls, for which we could log the entire call anyhow,
  benefit from a lower cost in bandwidth when the log is uploaded.

Compression takes place incrementally over the duration of the
call, avoiding a spike in resource utilization.

The file-size limit is very strictly abided by. Before compression
takes place, an estimation is made over whether the compressed
string will fit in the file without exceeding the budget. If not,
the file is terminated (as it would for the uncompressed version).

In the unlikely case that the estimation is mistaken, and we've
compressed to the point that writing to the file would make it
exceed its allotted maximum size, the file is dicarded. (It is
infeasible to write a compression footer at that point.)

Bug: 775415
Change-Id: Iab6b91815c4e9e855ced16668dbfd65ed64ad9f0
Reviewed-on: https://chromium-review.googlesource.com/1142147
Commit-Queue: Elad Alon <[email protected]>
Reviewed-by: Guido Urdaneta <[email protected]>
Cr-Commit-Position: refs/heads/master@{#580287}
13 files changed