Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: net/base/filter.h

Issue 6674042: Make URLRequestHttpJob the only URLRequestJob concerned with FilterContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responded to comments from willchan Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/filter.cc » ('j') | net/base/filter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filter.h
diff --git a/net/base/filter.h b/net/base/filter.h
index 4dacb64b1dce39dbc7943001052c420a9f47f741..a85b00cae26923d95b42ae353024514d5faf2dc3 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 gunzip filtered,
+ // 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,
+ // they return a fully initialized Filter. Otherwise, return NULL.
+ static Filter* InitGZipFilter(FilterType type_id, int buffer_size);
+ static Filter* InitSdchFilter(FilterType type_id,
+ const FilterContext& filter_context,
+ int buffer_size);
+
// Helper function to empty our output into the next filter's input.
void PushDataIntoNextFilter();
« no previous file with comments | « no previous file | net/base/filter.cc » ('j') | net/base/filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698