| 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 // 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 // Initializes filter decoding mode and internal control blocks. | 34 // Initializes filter decoding mode and internal control blocks. |
| 35 bool InitDecoding(Filter::FilterType filter_type); | 35 bool InitDecoding(Filter::FilterType filter_type); |
| 36 | 36 |
| 37 // Decode the pre-filter data and writes the output into |dest_buffer| | 37 // Decode the pre-filter data and writes the output into |dest_buffer| |
| 38 // The function returns FilterStatus. See filter.h for its description. | 38 // The function returns FilterStatus. See filter.h for its description. |
| 39 // | 39 // |
| 40 // Upon entry, *dest_len is the total size (in number of chars) of the | 40 // Upon entry, *dest_len is the total size (in number of chars) of the |
| 41 // destination buffer. Upon exit, *dest_len is the actual number of chars | 41 // destination buffer. Upon exit, *dest_len is the actual number of chars |
| 42 // written into the destination buffer. | 42 // written into the destination buffer. |
| 43 virtual FilterStatus ReadFilteredData(char* dest_buffer, | 43 virtual FilterStatus ReadFilteredData(char* dest_buffer, |
| 44 int* dest_len) OVERRIDE; | 44 int* dest_len) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Internal status. Once we enter an error state, we stop processing data. | 47 // Internal status. Once we enter an error state, we stop processing data. |
| 48 enum DecodingStatus { | 48 enum DecodingStatus { |
| 49 DECODING_UNINITIALIZED, | 49 DECODING_UNINITIALIZED, |
| 50 WAITING_FOR_DICTIONARY_SELECTION, | 50 WAITING_FOR_DICTIONARY_SELECTION, |
| 51 DECODING_IN_PROGRESS, | 51 DECODING_IN_PROGRESS, |
| 52 DECODING_ERROR, | 52 DECODING_ERROR, |
| 53 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. | 53 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. |
| 54 PASS_THROUGH, // Non-sdch content being passed without alteration. | 54 PASS_THROUGH, // Non-sdch content being passed without alteration. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // To facilitate error recovery, allow filter to know if content is text/html | 126 // To facilitate error recovery, allow filter to know if content is text/html |
| 127 // by checking within this mime type (we may do a meta-refresh via html). | 127 // by checking within this mime type (we may do a meta-refresh via html). |
| 128 std::string mime_type_; | 128 std::string mime_type_; |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 130 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace net | 133 } // namespace net |
| 134 | 134 |
| 135 #endif // NET_FILTER_SDCH_FILTER_H_ | 135 #endif // NET_FILTER_SDCH_FILTER_H_ |
| OLD | NEW |