recall: recompress chunks after mutation

In the previous CL I added on-the-fly decompression of gzip and deflate
encoded chunks when undergoing mutation (e.g. insertion of deterministic
JavaScript).

This CL adds recompression support, so that in the case of a server
sending compressed data, we still archive compressed data and still send
it to the client.

Slight changes to the previous CL are that the Content-Encoding header is
no longer dropped, and _decompressor is set to the actual object not the
method for consistency with the new _compressor member.

HTTP gzip compression is a little tricksy due to limitations of the
Python library.

BUG=none
TEST=verified with client tests

Change-Id: Idc45c63b0f50d781f9f7c0f3df0eaff2ab001e25
Reviewed-on: https://gerrit.chromium.org/gerrit/12578
Commit-Ready: Scott James Remnant <keybuk@chromium.org>
Tested-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Nirnimesh <nirnimesh@chromium.org>
Reviewed-by: Dennis Jeffrey <dennisjeffrey@chromium.org>
1 file changed