Chromium Code Reviews| Index: net/base/filter.h |
| diff --git a/net/base/filter.h b/net/base/filter.h |
| index 4dacb64b1dce39dbc7943001052c420a9f47f741..dc0249543abac46ae25056462a086a4214aefe9b 100644 |
| --- a/net/base/filter.h |
| +++ b/net/base/filter.h |
| @@ -138,16 +138,21 @@ class Filter { |
| // If success, the function returns the pointer to the Filter object created. |
| // If failed or a filter is not needed, the function returns NULL. |
| // |
| - // Note: filter_types is an array of filter names (content encoding types as |
| + // Note: filter_types is an array of filter types (content encoding types as |
| // provided in an HTTP header), which will be chained together serially to do |
| - // successive filtering of data. The names in the vector are ordered based on |
| + // successive filtering of data. The types in the vector are ordered based on |
| // encoding order, and the filters are chained to operate in the reverse |
| - // (decoding) order. For example, types[0] = "sdch", types[1] = "gzip" will |
| - // cause data to first be gunizip filtered, and the resulting output from that |
| - // filter will be sdch decoded. |
| + // (decoding) order. For example, types[0] = FILTER_TYPE_SDCH, |
| + // types[1] = FILTER_TYPE_GZIP will cause data to first be gunizip filtered, |
|
willchan no longer on Chromium
2011/03/16 23:13:17
gunizip? Existing typo I think.
adamk
2011/03/16 23:21:34
Done.
|
| + // and the resulting output from that filter will be sdch decoded. |
| static Filter* Factory(const std::vector<FilterType>& filter_types, |
| const FilterContext& filter_context); |
| + // A simpler version of Factory() which creates a single, unchained |
| + // Filter of type FILTER_TYPE_GZIP, or NULL if the filter could not be |
| + // initialized. |
| + static Filter* GZipFactory(); |
| + |
| // External call to obtain data from this filter chain. If ther is no |
| // next_filter_, then it obtains data from this specific filter. |
| FilterStatus ReadData(char* dest_buffer, int* dest_len); |
| @@ -241,6 +246,13 @@ class Filter { |
| int buffer_size, |
| Filter* filter_list); |
| + // Helper methods for PrependNewFilter. If initialization is successful, |
|
willchan no longer on Chromium
2011/03/16 23:13:17
My stylistic preference is to move these private s
adamk
2011/03/16 23:21:34
Can't do that, as the GZipFilter and SdchFilter co
|
| + // they return a fully initialized Filter. Otherwise, return NULL. |
| + static Filter* InitGZipFilter(FilterType type_id, int buffer_size); |
| + static Filter* InitSdchFilter(FilterType tyep_id, |
|
willchan no longer on Chromium
2011/03/16 23:13:17
tyep_id => type_id
adamk
2011/03/16 23:21:34
Done. I really like the WebKit style here, actual
|
| + const FilterContext& filter_context, |
| + int buffer_size); |
| + |
| // Helper function to empty our output into the next filter's input. |
| void PushDataIntoNextFilter(); |