OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 } | 637 } |
638 } | 638 } |
639 } | 639 } |
640 | 640 |
641 // Supply Accept-Encoding headers first so that it is more likely that they | 641 // Supply Accept-Encoding headers first so that it is more likely that they |
642 // will be in the first transmitted packet. This can sometimes make it easier | 642 // will be in the first transmitted packet. This can sometimes make it easier |
643 // to filter and analyze the streams to assure that a proxy has not damaged | 643 // to filter and analyze the streams to assure that a proxy has not damaged |
644 // these headers. Some proxies deliberately corrupt Accept-Encoding headers. | 644 // these headers. Some proxies deliberately corrupt Accept-Encoding headers. |
645 if (!advertise_sdch) { | 645 if (!advertise_sdch) { |
646 // Tell the server what compression formats we support (other than SDCH). | 646 // Tell the server what compression formats we support (other than SDCH). |
647 request_info_.extra_headers += "Accept-Encoding: gzip,deflate,bzip2\r\n"; | 647 request_info_.extra_headers += "Accept-Encoding: gzip,deflate\r\n"; |
648 } else { | 648 } else { |
649 // Include SDCH in acceptable list. | 649 // Include SDCH in acceptable list. |
650 request_info_.extra_headers += "Accept-Encoding: " | 650 request_info_.extra_headers += "Accept-Encoding: " |
651 "gzip,deflate,bzip2,sdch\r\n"; | 651 "gzip,deflate,sdch\r\n"; |
652 if (!avail_dictionaries.empty()) { | 652 if (!avail_dictionaries.empty()) { |
653 request_info_.extra_headers += "Avail-Dictionary: " | 653 request_info_.extra_headers += "Avail-Dictionary: " |
654 + avail_dictionaries + "\r\n"; | 654 + avail_dictionaries + "\r\n"; |
655 sdch_dictionary_advertised_ = true; | 655 sdch_dictionary_advertised_ = true; |
656 // Since we're tagging this transaction as advertising a dictionary, we'll | 656 // Since we're tagging this transaction as advertising a dictionary, we'll |
657 // definately employ an SDCH filter (or tentative sdch filter) when we get | 657 // definately employ an SDCH filter (or tentative sdch filter) when we get |
658 // a response. When done, we'll record histograms via SDCH_DECODE or | 658 // a response. When done, we'll record histograms via SDCH_DECODE or |
659 // SDCH_PASSTHROUGH. Hence we need to record packet arrival times. | 659 // SDCH_PASSTHROUGH. Hence we need to record packet arrival times. |
660 EnablePacketCounting(kSdchPacketHistogramCount); | 660 EnablePacketCounting(kSdchPacketHistogramCount); |
661 } | 661 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 if (!ctx || !ctx->force_tls_state()) | 725 if (!ctx || !ctx->force_tls_state()) |
726 return; | 726 return; |
727 | 727 |
728 std::string name = "X-Force-TLS"; | 728 std::string name = "X-Force-TLS"; |
729 std::string value; | 729 std::string value; |
730 | 730 |
731 void* iter = NULL; | 731 void* iter = NULL; |
732 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) | 732 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) |
733 ctx->force_tls_state()->DidReceiveHeader(request_info_.url, value); | 733 ctx->force_tls_state()->DidReceiveHeader(request_info_.url, value); |
734 } | 734 } |
OLD | NEW |