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

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

Issue 2956643002: Add GURL::HostNoBracketsPiece() (Closed)
Patch Set: Simplify test Created 3 years, 5 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
« no previous file with comments | « net/proxy/proxy_bypass_rules.cc ('k') | url/gurl.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) 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 <vector> 7 #include <vector>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 advertise_sdch = false; 616 advertise_sdch = false;
617 } else { 617 } else {
618 sdch_test_activated_ = true; 618 sdch_test_activated_ = true;
619 } 619 }
620 } 620 }
621 621
622 // Advertise "br" encoding only if transferred data is opaque to proxy. 622 // Advertise "br" encoding only if transferred data is opaque to proxy.
623 bool advertise_brotli = false; 623 bool advertise_brotli = false;
624 if (request()->context()->enable_brotli()) { 624 if (request()->context()->enable_brotli()) {
625 if (request()->url().SchemeIsCryptographic() || 625 if (request()->url().SchemeIsCryptographic() ||
626 IsLocalhost(request()->url().HostNoBrackets())) { 626 IsLocalhost(request()->url().HostNoBracketsPiece())) {
627 advertise_brotli = true; 627 advertise_brotli = true;
628 } 628 }
629 } 629 }
630 630
631 // Supply Accept-Encoding headers first so that it is more likely that they 631 // Supply Accept-Encoding headers first so that it is more likely that they
632 // will be in the first transmitted packet. This can sometimes make it 632 // will be in the first transmitted packet. This can sometimes make it
633 // easier to filter and analyze the streams to assure that a proxy has not 633 // easier to filter and analyze the streams to assure that a proxy has not
634 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding 634 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding
635 // headers. 635 // headers.
636 std::string advertised_encodings = "gzip, deflate"; 636 std::string advertised_encodings = "gzip, deflate";
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 awaiting_callback_ = false; 1576 awaiting_callback_ = false;
1577 1577
1578 // Notify NetworkQualityEstimator. 1578 // Notify NetworkQualityEstimator.
1579 NetworkQualityEstimator* network_quality_estimator = 1579 NetworkQualityEstimator* network_quality_estimator =
1580 request()->context()->network_quality_estimator(); 1580 request()->context()->network_quality_estimator();
1581 if (network_quality_estimator) 1581 if (network_quality_estimator)
1582 network_quality_estimator->NotifyURLRequestDestroyed(*request()); 1582 network_quality_estimator->NotifyURLRequestDestroyed(*request());
1583 } 1583 }
1584 1584
1585 } // namespace net 1585 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_bypass_rules.cc ('k') | url/gurl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698