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 // |
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 #pragma once | 16 #pragma once |
17 | 17 |
18 #include <string> | 18 #include <string> |
19 | 19 |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
21 #include "net/base/filter.h" | 21 #include "net/base/filter.h" |
| 22 #include "net/base/net_api.h" |
22 #include "net/base/sdch_manager.h" | 23 #include "net/base/sdch_manager.h" |
23 | 24 |
24 namespace open_vcdiff { | 25 namespace open_vcdiff { |
25 class VCDiffStreamingDecoder; | 26 class VCDiffStreamingDecoder; |
26 } | 27 } |
27 | 28 |
28 namespace net { | 29 namespace net { |
29 | 30 |
30 class SdchFilter : public Filter { | 31 class NET_TEST SdchFilter : public Filter { |
31 public: | 32 public: |
32 virtual ~SdchFilter(); | 33 virtual ~SdchFilter(); |
33 | 34 |
34 // Initializes filter decoding mode and internal control blocks. | 35 // Initializes filter decoding mode and internal control blocks. |
35 bool InitDecoding(Filter::FilterType filter_type); | 36 bool InitDecoding(Filter::FilterType filter_type); |
36 | 37 |
37 // 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| |
38 // The function returns FilterStatus. See filter.h for its description. | 39 // The function returns FilterStatus. See filter.h for its description. |
39 // | 40 // |
40 // 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 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // 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 |
119 // 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). |
120 std::string mime_type_; | 121 std::string mime_type_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(SdchFilter); | 123 DISALLOW_COPY_AND_ASSIGN(SdchFilter); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace net | 126 } // namespace net |
126 | 127 |
127 #endif // NET_BASE_SDCH_FILTER_H_ | 128 #endif // NET_BASE_SDCH_FILTER_H_ |
OLD | NEW |