OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "update_engine/gzip.h" | 5 #include "update_engine/gzip.h" |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <zlib.h> | 8 #include <zlib.h> |
9 #include "chromeos/obsolete_logging.h" | 9 #include "base/logging.h" |
10 #include "update_engine/utils.h" | 10 #include "update_engine/utils.h" |
11 | 11 |
12 using std::max; | 12 using std::max; |
13 using std::string; | 13 using std::string; |
14 using std::vector; | 14 using std::vector; |
15 | 15 |
16 namespace chromeos_update_engine { | 16 namespace chromeos_update_engine { |
17 | 17 |
18 bool GzipDecompressData(const char* const in, const size_t in_size, | 18 bool GzipDecompressData(const char* const in, const size_t in_size, |
19 char** out, size_t* out_size) { | 19 char** out, size_t* out_size) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 char* out_buf; | 176 char* out_buf; |
177 size_t out_size; | 177 size_t out_size; |
178 TEST_AND_RETURN_FALSE(GzipDecompressData(str.data(), str.size(), | 178 TEST_AND_RETURN_FALSE(GzipDecompressData(str.data(), str.size(), |
179 &out_buf, &out_size)); | 179 &out_buf, &out_size)); |
180 out->insert(out->end(), out_buf, out_buf + out_size); | 180 out->insert(out->end(), out_buf, out_buf + out_size); |
181 free(out_buf); | 181 free(out_buf); |
182 return true; | 182 return true; |
183 } | 183 } |
184 | 184 |
185 } // namespace chromeos_update_engine | 185 } // namespace chromeos_update_engine |
OLD | NEW |