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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 56034: Facilitate SDCH content decoding after a proxy removes ALL content info... (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
« no previous file with comments | « no previous file | no next file » | 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 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return false; 198 return false;
199 DCHECK(encoding_types->empty()); 199 DCHECK(encoding_types->empty());
200 200
201 std::string encoding_type; 201 std::string encoding_type;
202 void* iter = NULL; 202 void* iter = NULL;
203 while (response_info_->headers->EnumerateHeader(&iter, "Content-Encoding", 203 while (response_info_->headers->EnumerateHeader(&iter, "Content-Encoding",
204 &encoding_type)) { 204 &encoding_type)) {
205 encoding_types->push_back(Filter::ConvertEncodingToType(encoding_type)); 205 encoding_types->push_back(Filter::ConvertEncodingToType(encoding_type));
206 } 206 }
207 207
208 if (!encoding_types->empty()) { 208 // Even if encoding types are empty, there is a chance that we need to add
209 Filter::FixupEncodingTypes(*this, encoding_types); 209 // some decoding, as some proxies strip encoding completely. In such cases,
210 } 210 // we may need to add (for example) SDCH filtering (when the context suggests
211 // it is appropriate).
212 Filter::FixupEncodingTypes(*this, encoding_types);
213
211 return !encoding_types->empty(); 214 return !encoding_types->empty();
212 } 215 }
213 216
214 bool URLRequestHttpJob::IsSdchResponse() const { 217 bool URLRequestHttpJob::IsSdchResponse() const {
215 return response_info_ && 218 return response_info_ &&
216 (request_info_.load_flags & net::LOAD_SDCH_DICTIONARY_ADVERTISED); 219 (request_info_.load_flags & net::LOAD_SDCH_DICTIONARY_ADVERTISED);
217 } 220 }
218 221
219 bool URLRequestHttpJob::IsRedirectResponse(GURL* location, 222 bool URLRequestHttpJob::IsRedirectResponse(GURL* location,
220 int* http_status_code) { 223 int* http_status_code) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 DCHECK(response_info_); 606 DCHECK(response_info_);
604 DCHECK(response_cookies_.empty()); 607 DCHECK(response_cookies_.empty());
605 608
606 std::string name = "Set-Cookie"; 609 std::string name = "Set-Cookie";
607 std::string value; 610 std::string value;
608 611
609 void* iter = NULL; 612 void* iter = NULL;
610 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) 613 while (response_info_->headers->EnumerateHeader(&iter, name, &value))
611 response_cookies_.push_back(value); 614 response_cookies_.push_back(value);
612 } 615 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698