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

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

Issue 40319: Use filter context to track stats better in SDCH filtering (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 | « net/base/sdch_manager.h ('k') | net/url_request/url_request_job.h » ('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 #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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 DCHECK(encoding_types->empty()); 197 DCHECK(encoding_types->empty());
198 198
199 std::string encoding_type; 199 std::string encoding_type;
200 void* iter = NULL; 200 void* iter = NULL;
201 while (response_info_->headers->EnumerateHeader(&iter, "Content-Encoding", 201 while (response_info_->headers->EnumerateHeader(&iter, "Content-Encoding",
202 &encoding_type)) { 202 &encoding_type)) {
203 encoding_types->push_back(Filter::ConvertEncodingToType(encoding_type)); 203 encoding_types->push_back(Filter::ConvertEncodingToType(encoding_type));
204 } 204 }
205 205
206 if (!encoding_types->empty()) { 206 if (!encoding_types->empty()) {
207 std::string mime_type; 207 Filter::FixupEncodingTypes(*this, encoding_types);
208 GetMimeType(&mime_type);
209 // TODO(jar): Need to change this call to use the FilterContext interfaces.
210 Filter::FixupEncodingTypes(IsSdchResponse(), mime_type, encoding_types);
211 } 208 }
212 return !encoding_types->empty(); 209 return !encoding_types->empty();
213 } 210 }
214 211
215 bool URLRequestHttpJob::IsSdchResponse() const { 212 bool URLRequestHttpJob::IsSdchResponse() const {
216 return response_info_ && 213 return response_info_ &&
217 (request_info_.load_flags & net::LOAD_SDCH_DICTIONARY_ADVERTISED); 214 (request_info_.load_flags & net::LOAD_SDCH_DICTIONARY_ADVERTISED);
218 } 215 }
219 216
220 bool URLRequestHttpJob::IsRedirectResponse(GURL* location, 217 bool URLRequestHttpJob::IsRedirectResponse(GURL* location,
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 DCHECK(response_info_); 567 DCHECK(response_info_);
571 DCHECK(response_cookies_.empty()); 568 DCHECK(response_cookies_.empty());
572 569
573 std::string name = "Set-Cookie"; 570 std::string name = "Set-Cookie";
574 std::string value; 571 std::string value;
575 572
576 void* iter = NULL; 573 void* iter = NULL;
577 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) 574 while (response_info_->headers->EnumerateHeader(&iter, name, &value))
578 response_cookies_.push_back(value); 575 response_cookies_.push_back(value);
579 } 576 }
OLDNEW
« no previous file with comments | « net/base/sdch_manager.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698