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

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

Issue 1922403002: Move bool enable_brotli from HttpNetworkSession::Params (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittest fix Created 4 years, 7 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
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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 sdch_test_control_ = true; // 1% probability. 704 sdch_test_control_ = true; // 1% probability.
705 dictionaries_advertised_.reset(); 705 dictionaries_advertised_.reset();
706 advertise_sdch = false; 706 advertise_sdch = false;
707 } else { 707 } else {
708 sdch_test_activated_ = true; 708 sdch_test_activated_ = true;
709 } 709 }
710 } 710 }
711 711
712 // Advertise "br" encoding only if transferred data is opaque to proxy. 712 // Advertise "br" encoding only if transferred data is opaque to proxy.
713 bool advertise_brotli = false; 713 bool advertise_brotli = false;
714 const HttpNetworkSession::Params* network_session_params = 714 if (request()->context()->enable_brotli())
715 request()->context()->GetNetworkSessionParams();
716 if (network_session_params && network_session_params->enable_brotli)
717 advertise_brotli = request()->url().SchemeIsCryptographic(); 715 advertise_brotli = request()->url().SchemeIsCryptographic();
718 716
719 // Supply Accept-Encoding headers first so that it is more likely that they 717 // Supply Accept-Encoding headers first so that it is more likely that they
720 // will be in the first transmitted packet. This can sometimes make it 718 // will be in the first transmitted packet. This can sometimes make it
721 // easier to filter and analyze the streams to assure that a proxy has not 719 // easier to filter and analyze the streams to assure that a proxy has not
722 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding 720 // damaged these headers. Some proxies deliberately corrupt Accept-Encoding
723 // headers. 721 // headers.
724 std::string advertised_encodings = "gzip, deflate"; 722 std::string advertised_encodings = "gzip, deflate";
725 if (advertise_sdch) 723 if (advertise_sdch)
726 advertised_encodings += ", sdch"; 724 advertised_encodings += ", sdch";
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 return override_response_headers_.get() ? 1665 return override_response_headers_.get() ?
1668 override_response_headers_.get() : 1666 override_response_headers_.get() :
1669 transaction_->GetResponseInfo()->headers.get(); 1667 transaction_->GetResponseInfo()->headers.get();
1670 } 1668 }
1671 1669
1672 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1670 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1673 awaiting_callback_ = false; 1671 awaiting_callback_ = false;
1674 } 1672 }
1675 1673
1676 } // namespace net 1674 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context.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