| 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 // SdchFilter applies open_vcdiff content decoding to a datastream. | 5 // SdchFilter applies open_vcdiff content decoding to a datastream. |
| 6 // This decoding uses a pre-cached dictionary of text fragments to decode | 6 // This decoding uses a pre-cached dictionary of text fragments to decode |
| 7 // (expand) the stream back to its original contents. | 7 // (expand) the stream back to its original contents. |
| 8 // | 8 // |
| 9 // This SdchFilter internally uses open_vcdiff/vcdec library to do decoding. | 9 // This SdchFilter internally uses open_vcdiff/vcdec library to do decoding. |
| 10 // | 10 // |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Initializes filter decoding mode and internal control blocks. | 35 // Initializes filter decoding mode and internal control blocks. |
| 36 bool InitDecoding(Filter::FilterType filter_type); | 36 bool InitDecoding(Filter::FilterType filter_type); |
| 37 | 37 |
| 38 // Decode the pre-filter data and writes the output into |dest_buffer| | 38 // Decode the pre-filter data and writes the output into |dest_buffer| |
| 39 // The function returns FilterStatus. See filter.h for its description. | 39 // The function returns FilterStatus. See filter.h for its description. |
| 40 // | 40 // |
| 41 // Upon entry, *dest_len is the total size (in number of chars) of the | 41 // Upon entry, *dest_len is the total size (in number of chars) of the |
| 42 // destination buffer. Upon exit, *dest_len is the actual number of chars | 42 // destination buffer. Upon exit, *dest_len is the actual number of chars |
| 43 // written into the destination buffer. | 43 // written into the destination buffer. |
| 44 virtual FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len); | 44 virtual FilterStatus ReadFilteredData(char* dest_buffer, |
| 45 int* dest_len) OVERRIDE; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 // Internal status. Once we enter an error state, we stop processing data. | 48 // Internal status. Once we enter an error state, we stop processing data. |
| 48 enum DecodingStatus { | 49 enum DecodingStatus { |
| 49 DECODING_UNINITIALIZED, | 50 DECODING_UNINITIALIZED, |
| 50 WAITING_FOR_DICTIONARY_SELECTION, | 51 WAITING_FOR_DICTIONARY_SELECTION, |
| 51 DECODING_IN_PROGRESS, | 52 DECODING_IN_PROGRESS, |
| 52 DECODING_ERROR, | 53 DECODING_ERROR, |
| 53 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. | 54 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. |
| 54 PASS_THROUGH, // Non-sdch content being passed without alteration. | 55 PASS_THROUGH, // Non-sdch content being passed without alteration. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // To facilitate error recovery, allow filter to know if content is text/html | 120 // To facilitate error recovery, allow filter to know if content is text/html |
| 120 // by checking within this mime type (we may do a meta-refresh via html). | 121 // by checking within this mime type (we may do a meta-refresh via html). |
| 121 std::string mime_type_; | 122 std::string mime_type_; |
| 122 | 123 |
| 123 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 124 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 } // namespace net | 127 } // namespace net |
| 127 | 128 |
| 128 #endif // NET_BASE_SDCH_FILTER_H_ | 129 #endif // NET_BASE_SDCH_FILTER_H_ |
| OLD | NEW |