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

Unified Diff: net/url_request/url_request_http_job.cc

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
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 56de7839cc103489ee5ebdd3b482cd36b175e51a..480833abca61408ea5372e8220964e985dd981e9 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -731,27 +731,27 @@ int URLRequestHttpJob::GetResponseCode() const {
return response_info_->headers->response_code();
}
-bool URLRequestHttpJob::GetContentEncodings(
- std::vector<Filter::FilterType>* encoding_types) {
+Filter* URLRequestHttpJob::SetupFilter() const {
DCHECK(transaction_.get());
if (!response_info_)
- return false;
- DCHECK(encoding_types->empty());
+ return NULL;
+ std::vector<Filter::FilterType> encoding_types;
std::string encoding_type;
void* iter = NULL;
while (response_info_->headers->EnumerateHeader(&iter, "Content-Encoding",
&encoding_type)) {
- encoding_types->push_back(Filter::ConvertEncodingToType(encoding_type));
+ encoding_types.push_back(Filter::ConvertEncodingToType(encoding_type));
}
// Even if encoding types are empty, there is a chance that we need to add
// some decoding, as some proxies strip encoding completely. In such cases,
// we may need to add (for example) SDCH filtering (when the context suggests
// it is appropriate).
- Filter::FixupEncodingTypes(*this, encoding_types);
+ Filter::FixupEncodingTypes(*this, &encoding_types);
- return !encoding_types->empty();
+ return !encoding_types.empty()
+ ? Filter::Factory(encoding_types, *this) : NULL;
}
bool URLRequestHttpJob::IsCachedContent() const {

Powered by Google App Engine
This is Rietveld 408576698