OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/gzip_header.h" | 5 #include "net/base/gzip_header.h" |
6 | 6 |
7 #if defined(USE_SYSTEM_ZLIB) | |
8 #include <zlib.h> | |
9 #else | |
10 #include "third_party/zlib/zlib.h" // for Z_DEFAULT_COMPRESSION | |
11 #endif | |
12 | |
13 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/zlib/zlib.h" |
14 | 9 |
15 namespace net { | 10 namespace net { |
16 | 11 |
17 const uint8 GZipHeader::magic[] = { 0x1f, 0x8b }; | 12 const uint8 GZipHeader::magic[] = { 0x1f, 0x8b }; |
18 | 13 |
19 GZipHeader::GZipHeader() { | 14 GZipHeader::GZipHeader() { |
20 Reset(); | 15 Reset(); |
21 } | 16 } |
22 | 17 |
23 GZipHeader::~GZipHeader() { | 18 GZipHeader::~GZipHeader() { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 170 |
176 if ( (state_ > IN_HEADER_OS) && (flags_ == 0) ) { | 171 if ( (state_ > IN_HEADER_OS) && (flags_ == 0) ) { |
177 *header_end = reinterpret_cast<const char*>(pos); | 172 *header_end = reinterpret_cast<const char*>(pos); |
178 return COMPLETE_HEADER; | 173 return COMPLETE_HEADER; |
179 } else { | 174 } else { |
180 return INCOMPLETE_HEADER; | 175 return INCOMPLETE_HEADER; |
181 } | 176 } |
182 } | 177 } |
183 | 178 |
184 } // namespace net | 179 } // namespace net |
OLD | NEW |