| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // GZipFilter applies gzip and deflate content encoding/decoding to a data | 5 // GZipFilter applies gzip and deflate content encoding/decoding to a data |
| 6 // stream. As specified by HTTP 1.1, with gzip encoding the content is | 6 // stream. As specified by HTTP 1.1, with gzip encoding the content is |
| 7 // wrapped with a gzip header, and with deflate encoding the content is in | 7 // wrapped with a gzip header, and with deflate encoding the content is in |
| 8 // a raw, headerless DEFLATE stream. | 8 // a raw, headerless DEFLATE stream. |
| 9 // | 9 // |
| 10 // Internally GZipFilter uses zlib inflate to do decoding. | 10 // Internally GZipFilter uses zlib inflate to do decoding. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // | 42 // |
| 43 // Upon entry, *dest_len is the total size (in number of chars) of the | 43 // Upon entry, *dest_len is the total size (in number of chars) of the |
| 44 // destination buffer. Upon exit, *dest_len is the actual number of chars | 44 // destination buffer. Upon exit, *dest_len is the actual number of chars |
| 45 // written into the destination buffer. | 45 // written into the destination buffer. |
| 46 // | 46 // |
| 47 // This function will fail if there is no pre-filter data in the | 47 // This function will fail if there is no pre-filter data in the |
| 48 // stream_buffer_. On the other hand, *dest_len can be 0 upon successful | 48 // stream_buffer_. On the other hand, *dest_len can be 0 upon successful |
| 49 // return. For example, the internal zlib may process some pre-filter data | 49 // return. For example, the internal zlib may process some pre-filter data |
| 50 // but not produce output yet. | 50 // but not produce output yet. |
| 51 virtual FilterStatus ReadFilteredData(char* dest_buffer, | 51 virtual FilterStatus ReadFilteredData(char* dest_buffer, |
| 52 int* dest_len) OVERRIDE; | 52 int* dest_len) override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 enum DecodingStatus { | 55 enum DecodingStatus { |
| 56 DECODING_UNINITIALIZED, | 56 DECODING_UNINITIALIZED, |
| 57 DECODING_IN_PROGRESS, | 57 DECODING_IN_PROGRESS, |
| 58 DECODING_DONE, | 58 DECODING_DONE, |
| 59 DECODING_ERROR | 59 DECODING_ERROR |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 enum DecodingMode { | 62 enum DecodingMode { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // If this flag is set, then we will revert to being a pass through filter if | 142 // If this flag is set, then we will revert to being a pass through filter if |
| 143 // we don't get a valid gzip header. | 143 // we don't get a valid gzip header. |
| 144 bool possible_sdch_pass_through_; | 144 bool possible_sdch_pass_through_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(GZipFilter); | 146 DISALLOW_COPY_AND_ASSIGN(GZipFilter); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace net | 149 } // namespace net |
| 150 | 150 |
| 151 #endif // NET_FILTER_GZIP_FILTER_H__ | 151 #endif // NET_FILTER_GZIP_FILTER_H__ |
| OLD | NEW |