| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Only to be instantiated by Filter::Factory. | 57 // Only to be instantiated by Filter::Factory. |
| 58 explicit SdchFilter(const FilterContext& filter_context); | 58 explicit SdchFilter(const FilterContext& filter_context); |
| 59 friend class Filter; | 59 friend class Filter; |
| 60 | 60 |
| 61 // Identify the suggested dictionary, and initialize underlying decompressor. | 61 // Identify the suggested dictionary, and initialize underlying decompressor. |
| 62 Filter::FilterStatus InitializeDictionary(); | 62 Filter::FilterStatus InitializeDictionary(); |
| 63 | 63 |
| 64 // Move data that was internally buffered (after decompression) to the | 64 // Move data that was internally buffered (after decompression) to the |
| (...skipping 54 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 | 119 // 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). | 120 // by checking within this mime type (we may do a meta-refresh via html). |
| 121 std::string mime_type_; | 121 std::string mime_type_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 123 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace net | 126 } // namespace net |
| 127 | 127 |
| 128 #endif // NET_FILTER_SDCH_FILTER_H_ | 128 #endif // NET_FILTER_SDCH_FILTER_H_ |
| OLD | NEW |