diff options
author | Benoit Lize <lizeb@chromium.org> | 2018-09-04 07:41:47 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-09-04 07:41:47 +0000 |
commit | 04f266debc4bd7e487241769b78af0c51a603e34 (patch) | |
tree | d5bacefa066bfbbc20d0ccbd4fe1f7953c487521 /google | |
parent | de0fe056df0577ea69cbf5f46dfe66debe046e5c (diff) | |
download | zlib-04f266debc4bd7e487241769b78af0c51a603e34.tar.gz |
zlib/google: Make GzipCompress() take a StringPiece.
Bug: 877044
Change-Id: I193aec9eaf8e0f59413b4b0c58489aeac48b5ad2
Reviewed-on: https://chromium-review.googlesource.com/1202143
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#588465}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 14a94ec56fbf0792c4f28adee97979645ef021ea
Diffstat (limited to 'google')
-rw-r--r-- | google/compression_utils.cc | 2 | ||||
-rw-r--r-- | google/compression_utils.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/google/compression_utils.cc b/google/compression_utils.cc index e7be1e9..dfa42a1 100644 --- a/google/compression_utils.cc +++ b/google/compression_utils.cc @@ -123,7 +123,7 @@ int GzipUncompressHelper(Bytef* dest, namespace compression { -bool GzipCompress(const std::string& input, std::string* output) { +bool GzipCompress(base::StringPiece input, std::string* output) { const uLongf input_size = static_cast<uLongf>(input.size()); std::vector<Bytef> compressed_data(kGzipZlibHeaderDifferenceBytes + compressBound(input_size)); diff --git a/google/compression_utils.h b/google/compression_utils.h index d496ef1..a29f5b1 100644 --- a/google/compression_utils.h +++ b/google/compression_utils.h @@ -12,8 +12,9 @@ namespace compression { // Compresses the data in |input| using gzip, storing the result in |output|. -// |input| and |output| are allowed to be the same string (in-place operation). -bool GzipCompress(const std::string& input, std::string* output); +// |input| and |output| are allowed to point to the same string (in-place +// operation). +bool GzipCompress(base::StringPiece input, std::string* output); // Uncompresses the data in |input| using gzip, storing the result in |output|. // |input| and |output| are allowed to be the same string (in-place operation). |