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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: IOS io_thread also initializes DynamicSharedParams Created 4 years 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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 633
634 // Check for OS support of TCP FastOpen, and turn it on for all connections if 634 // Check for OS support of TCP FastOpen, and turn it on for all connections if
635 // indicated by user. 635 // indicated by user.
636 // TODO(rch): Make the client socket factory a per-network session instance, 636 // TODO(rch): Make the client socket factory a per-network session instance,
637 // constructed from a NetworkSession::Params, to allow us to move this option 637 // constructed from a NetworkSession::Params, to allow us to move this option
638 // to IOThread::Globals & HttpNetworkSession::Params. 638 // to IOThread::Globals & HttpNetworkSession::Params.
639 bool always_enable_tfo_if_supported = 639 bool always_enable_tfo_if_supported =
640 command_line.HasSwitch(switches::kEnableTcpFastOpen); 640 command_line.HasSwitch(switches::kEnableTcpFastOpen);
641 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_tfo_if_supported); 641 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_tfo_if_supported);
642 642
643 globals_->http_network_session_dynamic_shared_params.reset(
Bence 2016/12/20 14:58:07 Please consider assigning to base::MakeUnique<>()
pmarko 2016/12/20 18:00:37 Done.
644 new net::HttpNetworkSession::DynamicSharedParams());
645 params_.dynamic_shared_params =
646 globals_->http_network_session_dynamic_shared_params.get();
647
643 ConfigureParamsFromFieldTrialsAndCommandLine( 648 ConfigureParamsFromFieldTrialsAndCommandLine(
644 command_line, is_quic_allowed_by_policy_, 649 command_line, is_quic_allowed_by_policy_,
645 http_09_on_non_default_ports_enabled_, &params_); 650 http_09_on_non_default_ports_enabled_, &params_);
646 651
647 TRACE_EVENT_BEGIN0("startup", 652 TRACE_EVENT_BEGIN0("startup",
648 "IOThread::Init:ProxyScriptFetcherRequestContext"); 653 "IOThread::Init:ProxyScriptFetcherRequestContext");
649 globals_->proxy_script_fetcher_context.reset( 654 globals_->proxy_script_fetcher_context.reset(
650 ConstructProxyScriptFetcherContext(globals_, params_, net_log_)); 655 ConstructProxyScriptFetcherContext(globals_, params_, net_log_));
651 TRACE_EVENT_END0("startup", 656 TRACE_EVENT_END0("startup",
652 "IOThread::Init:ProxyScriptFetcherRequestContext"); 657 "IOThread::Init:ProxyScriptFetcherRequestContext");
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 is_quic_force_enabled, 946 is_quic_force_enabled,
942 quic_user_agent_id, params); 947 quic_user_agent_id, params);
943 948
944 // Command line flags override field trials. 949 // Command line flags override field trials.
945 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) 950 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests))
946 net::URLFetcher::SetIgnoreCertificateRequests(true); 951 net::URLFetcher::SetIgnoreCertificateRequests(true);
947 952
948 if (command_line.HasSwitch(switches::kDisableHttp2)) 953 if (command_line.HasSwitch(switches::kDisableHttp2))
949 params->enable_http2 = false; 954 params->enable_http2 = false;
950 955
951 if (params->enable_quic) { 956 if (params->enable_quic()) {
952 if (command_line.HasSwitch(switches::kQuicConnectionOptions)) { 957 if (command_line.HasSwitch(switches::kQuicConnectionOptions)) {
953 params->quic_connection_options = 958 params->quic_connection_options =
954 net::QuicUtils::ParseQuicConnectionOptions( 959 net::QuicUtils::ParseQuicConnectionOptions(
955 command_line.GetSwitchValueASCII( 960 command_line.GetSwitchValueASCII(
956 switches::kQuicConnectionOptions)); 961 switches::kQuicConnectionOptions));
957 } 962 }
958 963
959 if (command_line.HasSwitch(switches::kQuicHostWhitelist)) { 964 if (command_line.HasSwitch(switches::kQuicHostWhitelist)) {
960 std::string whitelist = 965 std::string whitelist =
961 command_line.GetSwitchValueASCII(switches::kQuicHostWhitelist); 966 command_line.GetSwitchValueASCII(switches::kQuicHostWhitelist);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1093
1089 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1094 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1090 // system URLRequestContext too. There's no reason this should be tied to a 1095 // system URLRequestContext too. There's no reason this should be tied to a
1091 // profile. 1096 // profile.
1092 return context; 1097 return context;
1093 } 1098 }
1094 1099
1095 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { 1100 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() {
1096 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); 1101 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread);
1097 } 1102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698