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

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

Issue 437353004: Add space to Accept-Encoding header values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update SDCH test tokenization. Created 6 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 514 }
515 515
516 // Supply Accept-Encoding headers first so that it is more likely that they 516 // Supply Accept-Encoding headers first so that it is more likely that they
517 // will be in the first transmitted packet. This can sometimes make it 517 // will be in the first transmitted packet. This can sometimes make it
518 // easier to filter and analyze the streams to assure that a proxy has not 518 // easier to filter and analyze the streams to assure that a proxy has not
519 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding 519 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding
520 // headers. 520 // headers.
521 if (!advertise_sdch) { 521 if (!advertise_sdch) {
522 // Tell the server what compression formats we support (other than SDCH). 522 // Tell the server what compression formats we support (other than SDCH).
523 request_info_.extra_headers.SetHeader( 523 request_info_.extra_headers.SetHeader(
524 HttpRequestHeaders::kAcceptEncoding, "gzip,deflate"); 524 HttpRequestHeaders::kAcceptEncoding, "gzip, deflate");
525 } else { 525 } else {
526 // Include SDCH in acceptable list. 526 // Include SDCH in acceptable list.
527 request_info_.extra_headers.SetHeader( 527 request_info_.extra_headers.SetHeader(
528 HttpRequestHeaders::kAcceptEncoding, "gzip,deflate,sdch"); 528 HttpRequestHeaders::kAcceptEncoding, "gzip, deflate, sdch");
529 if (!avail_dictionaries.empty()) { 529 if (!avail_dictionaries.empty()) {
530 request_info_.extra_headers.SetHeader( 530 request_info_.extra_headers.SetHeader(
531 kAvailDictionaryHeader, 531 kAvailDictionaryHeader,
532 avail_dictionaries); 532 avail_dictionaries);
533 sdch_dictionary_advertised_ = true; 533 sdch_dictionary_advertised_ = true;
534 // Since we're tagging this transaction as advertising a dictionary, 534 // Since we're tagging this transaction as advertising a dictionary,
535 // we'll definitely employ an SDCH filter (or tentative sdch filter) 535 // we'll definitely employ an SDCH filter (or tentative sdch filter)
536 // when we get a response. When done, we'll record histograms via 536 // when we get a response. When done, we'll record histograms via
537 // SDCH_DECODE or SDCH_PASSTHROUGH. Hence we need to record packet 537 // SDCH_DECODE or SDCH_PASSTHROUGH. Hence we need to record packet
538 // arrival times. 538 // arrival times.
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 return override_response_headers_.get() ? 1522 return override_response_headers_.get() ?
1523 override_response_headers_.get() : 1523 override_response_headers_.get() :
1524 transaction_->GetResponseInfo()->headers.get(); 1524 transaction_->GetResponseInfo()->headers.get();
1525 } 1525 }
1526 1526
1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1528 awaiting_callback_ = false; 1528 awaiting_callback_ = false;
1529 } 1529 }
1530 1530
1531 } // namespace net 1531 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698