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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 enum DecodingStatus { | 47 enum DecodingStatus { |
48 DECODING_UNINITIALIZED, | 48 DECODING_UNINITIALIZED, |
49 WAITING_FOR_DICTIONARY_SELECTION, | 49 WAITING_FOR_DICTIONARY_SELECTION, |
50 DECODING_IN_PROGRESS, | 50 DECODING_IN_PROGRESS, |
51 DECODING_ERROR, | 51 DECODING_ERROR, |
52 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. | 52 META_REFRESH_RECOVERY, // Decoding error being handled by a meta-refresh. |
53 PASS_THROUGH, // Non-sdch content being passed without alteration. | 53 PASS_THROUGH, // Non-sdch content being passed without alteration. |
54 }; | 54 }; |
55 | 55 |
56 // Only to be instantiated by Filter::Factory. | 56 // Only to be instantiated by Filter::Factory. |
57 explicit SdchFilter(const FilterContext& filter_context); | 57 SdchFilter(FilterType type, const FilterContext& filter_context); |
58 friend class Filter; | 58 friend class Filter; |
59 | 59 |
60 // Identify the suggested dictionary, and initialize underlying decompressor. | 60 // Identify the suggested dictionary, and initialize underlying decompressor. |
61 Filter::FilterStatus InitializeDictionary(); | 61 Filter::FilterStatus InitializeDictionary(); |
62 | 62 |
63 // Move data that was internally buffered (after decompression) to the | 63 // Move data that was internally buffered (after decompression) to the |
64 // specified dest_buffer. | 64 // specified dest_buffer. |
65 int OutputBufferExcess(char* const dest_buffer, size_t available_space); | 65 int OutputBufferExcess(char* const dest_buffer, size_t available_space); |
66 | 66 |
67 // Add SDCH Problem to net-log and record histogram. | 67 // Add SDCH Problem to net-log and record histogram. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // To facilitate error recovery, allow filter to know if content is text/html | 128 // To facilitate error recovery, allow filter to know if content is text/html |
129 // by checking within this mime type (we may do a meta-refresh via html). | 129 // by checking within this mime type (we may do a meta-refresh via html). |
130 std::string mime_type_; | 130 std::string mime_type_; |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 132 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
133 }; | 133 }; |
134 | 134 |
135 } // namespace net | 135 } // namespace net |
136 | 136 |
137 #endif // NET_FILTER_SDCH_FILTER_H_ | 137 #endif // NET_FILTER_SDCH_FILTER_H_ |
OLD | NEW |