| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/filter.h" | 5 #include "net/base/filter.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/base/gzip_filter.h" | 9 #include "net/base/gzip_filter.h" |
| 10 #include "net/base/bzip2_filter.h" | 10 #include "net/base/bzip2_filter.h" |
| 11 #include "net/base/io_buffer.h" |
| 11 #include "net/base/sdch_filter.h" | 12 #include "net/base/sdch_filter.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 // Filter types (using canonical lower case only): | 16 // Filter types (using canonical lower case only): |
| 16 const char kDeflate[] = "deflate"; | 17 const char kDeflate[] = "deflate"; |
| 17 const char kGZip[] = "gzip"; | 18 const char kGZip[] = "gzip"; |
| 18 const char kXGZip[] = "x-gzip"; | 19 const char kXGZip[] = "x-gzip"; |
| 19 const char kBZip2[] = "bzip2"; | 20 const char kBZip2[] = "bzip2"; |
| 20 const char kXBZip2[] = "x-bzip2"; | 21 const char kXBZip2[] = "x-bzip2"; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 360 |
| 360 DCHECK(stream_buffer()); | 361 DCHECK(stream_buffer()); |
| 361 // Bail out if there is more data in the stream buffer to be filtered. | 362 // Bail out if there is more data in the stream buffer to be filtered. |
| 362 if (!stream_buffer() || stream_data_len_) | 363 if (!stream_buffer() || stream_data_len_) |
| 363 return false; | 364 return false; |
| 364 | 365 |
| 365 next_stream_data_ = stream_buffer()->data(); | 366 next_stream_data_ = stream_buffer()->data(); |
| 366 stream_data_len_ = stream_data_len; | 367 stream_data_len_ = stream_data_len; |
| 367 return true; | 368 return true; |
| 368 } | 369 } |
| OLD | NEW |