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

Side by Side Diff: net/url_request/url_request_job.h

Issue 62111: Give the filter setup more context so it can figure out whether it's download... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « net/base/load_flags.h ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // For example, encoding_types[0] = FILTER_TYPE_SDCH and encoding_types[1] = 112 // For example, encoding_types[0] = FILTER_TYPE_SDCH and encoding_types[1] =
113 // FILTER_TYPE_GZIP, means the content was first encoded by sdch, and then 113 // FILTER_TYPE_GZIP, means the content was first encoded by sdch, and then
114 // result was encoded by gzip. To decode, a series of filters must be applied 114 // result was encoded by gzip. To decode, a series of filters must be applied
115 // in the reverse order (in the above example, ungzip first, and then sdch 115 // in the reverse order (in the above example, ungzip first, and then sdch
116 // expand). 116 // expand).
117 virtual bool GetContentEncodings( 117 virtual bool GetContentEncodings(
118 std::vector<Filter::FilterType>* encoding_types) { 118 std::vector<Filter::FilterType>* encoding_types) {
119 return false; 119 return false;
120 } 120 }
121 121
122 // Find out if this is a download.
123 virtual bool IsDownload() const;
124
122 // Find out if this is a response to a request that advertised an SDCH 125 // Find out if this is a response to a request that advertised an SDCH
123 // dictionary. Only makes sense for some types of requests. 126 // dictionary. Only makes sense for some types of requests.
124 virtual bool IsSdchResponse() const { return false; } 127 virtual bool IsSdchResponse() const { return false; }
jar (doing other things) 2009/04/10 20:27:14 One element that I think is questionable is the di
Lei Zhang 2009/04/10 21:25:21 SDCH only makes sense for http right? To me, downl
jar (doing other things) 2009/04/10 22:10:09 SDCH is currently outlawed by the spec for simplic
125 128
126 // Called to setup stream filter for this request. An example of filter is 129 // Called to setup stream filter for this request. An example of filter is
127 // content encoding/decoding. 130 // content encoding/decoding.
128 void SetupFilter(); 131 void SetupFilter();
129 132
130 // Called to determine if this response is a redirect. Only makes sense 133 // Called to determine if this response is a redirect. Only makes sense
131 // for some types of requests. This method returns true if the response 134 // for some types of requests. This method returns true if the response
132 // is a redirect, and fills in the location param with the URL of the 135 // is a redirect, and fills in the location param with the URL of the
133 // redirect. The HTTP status code (e.g., 302) is filled into 136 // redirect. The HTTP status code (e.g., 302) is filled into
134 // |*http_status_code| to signify the type of redirect. 137 // |*http_status_code| to signify the type of redirect.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 private: 289 private:
287 // Called to query whether there is data available in the filter to be read 290 // Called to query whether there is data available in the filter to be read
288 // out. 291 // out.
289 bool FilterHasData(); 292 bool FilterHasData();
290 293
291 // Indicates that the job is done producing data, either it has completed 294 // Indicates that the job is done producing data, either it has completed
292 // all the data or an error has been encountered. Set exclusively by 295 // all the data or an error has been encountered. Set exclusively by
293 // NotifyDone so that it is kept in sync with the request. 296 // NotifyDone so that it is kept in sync with the request.
294 bool done_; 297 bool done_;
295 298
299 // Cache the load flags from request_ because it might go away.
300 int load_flags_;
301
296 // The data stream filter which is enabled on demand. 302 // The data stream filter which is enabled on demand.
297 scoped_ptr<Filter> filter_; 303 scoped_ptr<Filter> filter_;
298 304
299 // If the filter filled its output buffer, then there is a change that it 305 // If the filter filled its output buffer, then there is a change that it
300 // still has internal data to emit, and this flag is set. 306 // still has internal data to emit, and this flag is set.
301 bool filter_needs_more_output_space_; 307 bool filter_needs_more_output_space_;
302 308
303 // When we filter data, we receive data into the filter buffers. After 309 // When we filter data, we receive data into the filter buffers. After
304 // processing the filtered data, we return the data in the caller's buffer. 310 // processing the filtered data, we return the data in the caller's buffer.
305 // While the async IO is in progress, we save the user buffer here, and 311 // While the async IO is in progress, we save the user buffer here, and
(...skipping 10 matching lines...) Expand all
316 322
317 // Total number of bytes read from network (or cache) and and typically handed 323 // Total number of bytes read from network (or cache) and and typically handed
318 // to filter to process. Used to histogram compression ratios, and error 324 // to filter to process. Used to histogram compression ratios, and error
319 // recovery scenarios in filters. 325 // recovery scenarios in filters.
320 int64 filter_input_byte_count_; 326 int64 filter_input_byte_count_;
321 327
322 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 328 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
323 }; 329 };
324 330
325 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 331 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « net/base/load_flags.h ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698