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

Side by Side Diff: net/base/gzip_filter.h

Issue 40138: Use FilterContext to allow filters to access URLRequestJob data... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // GZipFilter applies gzip and deflate content encoding/decoding to a data 5 // GZipFilter applies gzip and deflate content encoding/decoding to a data
6 // stream. As specified by HTTP 1.1, with gzip encoding the content is 6 // stream. As specified by HTTP 1.1, with gzip encoding the content is
7 // wrapped with a gzip header, and with deflate encoding the content is in 7 // wrapped with a gzip header, and with deflate encoding the content is in
8 // a raw, headerless DEFLATE stream. 8 // a raw, headerless DEFLATE stream.
9 // 9 //
10 // Internally GZipFilter uses zlib inflate to do decoding. 10 // Internally GZipFilter uses zlib inflate to do decoding.
11 // 11 //
12 // GZipFilter is a subclass of Filter. See the latter's header file filter.h 12 // GZipFilter is a subclass of Filter. See the latter's header file filter.h
13 // for sample usage. 13 // for sample usage.
14 14
15 #ifndef NET_BASE_GZIP_FILTER_H__ 15 #ifndef NET_BASE_GZIP_FILTER_H__
16 #define NET_BASE_GZIP_FILTER_H__ 16 #define NET_BASE_GZIP_FILTER_H__
17 17
18 #include "base/scoped_ptr.h" 18 #include "base/scoped_ptr.h"
19 #include "net/base/filter.h" 19 #include "net/base/filter.h"
20 20
21 class GZipHeader; 21 class GZipHeader;
22 typedef struct z_stream_s z_stream; 22 typedef struct z_stream_s z_stream;
23 23
24 class GZipFilter : public Filter { 24 class GZipFilter : public Filter {
25 public: 25 public:
26 GZipFilter(); 26 explicit GZipFilter(const FilterContext& filter_context);
27 27
28 virtual ~GZipFilter(); 28 virtual ~GZipFilter();
29 29
30 // Initializes filter decoding mode and internal control blocks. 30 // Initializes filter decoding mode and internal control blocks.
31 // Parameter filter_type specifies the type of filter, which corresponds to 31 // Parameter filter_type specifies the type of filter, which corresponds to
32 // either gzip or deflate decoding. The function returns true if success and 32 // either gzip or deflate decoding. The function returns true if success and
33 // false otherwise. 33 // false otherwise.
34 // The filter can only be initialized once. 34 // The filter can only be initialized once.
35 bool InitDecoding(Filter::FilterType filter_type); 35 bool InitDecoding(Filter::FilterType filter_type);
36 36
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // content is indeed really gzipped result of sdch :-/. 134 // content is indeed really gzipped result of sdch :-/.
135 // If this flag is set, then we will revert to being a pass through filter if 135 // If this flag is set, then we will revert to being a pass through filter if
136 // we don't get a valid gzip header. 136 // we don't get a valid gzip header.
137 bool possible_sdch_pass_through_; 137 bool possible_sdch_pass_through_;
138 138
139 DISALLOW_EVIL_CONSTRUCTORS(GZipFilter); 139 DISALLOW_EVIL_CONSTRUCTORS(GZipFilter);
140 }; 140 };
141 141
142 #endif // NET_BASE_GZIP_FILTER_H__ 142 #endif // NET_BASE_GZIP_FILTER_H__
143 143
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698