OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // |
11 // SdchFilter is also a subclass of Filter. See the latter's header file | 11 // SdchFilter is also a subclass of Filter. See the latter's header file |
12 // filter.h for sample usage. | 12 // filter.h for sample usage. |
13 | 13 |
14 #ifndef NET_BASE_SDCH_FILTER_H_ | 14 #ifndef NET_BASE_SDCH_FILTER_H_ |
15 #define NET_BASE_SDCH_FILTER_H_ | 15 #define NET_BASE_SDCH_FILTER_H_ |
16 | 16 |
17 #include <string> | 17 #include <string> |
| 18 #include <vector> |
18 | 19 |
19 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
20 #include "net/base/filter.h" | 21 #include "net/base/filter.h" |
21 #include "net/base/sdch_manager.h" | 22 #include "net/base/sdch_manager.h" |
22 | 23 |
23 class SafeOutputStringInterface; | 24 class SafeOutputStringInterface; |
24 | 25 |
25 namespace open_vcdiff { | 26 namespace open_vcdiff { |
26 class VCDiffStreamingDecoder; | 27 class VCDiffStreamingDecoder; |
27 } | 28 } |
28 | 29 |
29 class SdchFilter : public Filter { | 30 class SdchFilter : public Filter { |
30 public: | 31 public: |
31 SdchFilter(); | 32 explicit SdchFilter(const FilterContext& filter_context); |
32 | 33 |
33 virtual ~SdchFilter(); | 34 virtual ~SdchFilter(); |
34 | 35 |
35 // Initializes filter decoding mode and internal control blocks. | 36 // Initializes filter decoding mode and internal control blocks. |
36 bool InitDecoding(Filter::FilterType filter_type); | 37 bool InitDecoding(Filter::FilterType filter_type); |
37 | 38 |
38 // Decode the pre-filter data and writes the output into |dest_buffer| | 39 // Decode the pre-filter data and writes the output into |dest_buffer| |
39 // The function returns FilterStatus. See filter.h for its description. | 40 // The function returns FilterStatus. See filter.h for its description. |
40 // | 41 // |
41 // Upon entry, *dest_len is the total size (in number of chars) of the | 42 // Upon entry, *dest_len is the total size (in number of chars) of the |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 106 |
106 // Error recovery in content type may add an sdch filter type, in which case | 107 // Error recovery in content type may add an sdch filter type, in which case |
107 // we should gracefully perform pass through if the format is incorrect, or | 108 // we should gracefully perform pass through if the format is incorrect, or |
108 // an applicable dictionary can't be found. | 109 // an applicable dictionary can't be found. |
109 bool possible_pass_through_; | 110 bool possible_pass_through_; |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 112 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
112 }; | 113 }; |
113 | 114 |
114 #endif // NET_BASE_SDCH_FILTER_H_ | 115 #endif // NET_BASE_SDCH_FILTER_H_ |
OLD | NEW |