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

Unified Diff: chrome/browser/io_thread.cc

Issue 2299703003: Re-land: Only allow HTTP/0.9 support on default ports. (Closed)
Patch Set: Fix test Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/io_thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 08a0f09dba8462236e7653a901050b95e6025f68..e290a446d4789bb99b6d2f1678f6c35a960c22d3 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -318,8 +318,9 @@ IOThread::IOThread(
#if defined(ENABLE_EXTENSIONS)
extension_event_router_forwarder_(extension_event_router_forwarder),
#endif
- globals_(NULL),
+ globals_(nullptr),
is_quic_allowed_by_policy_(true),
+ http_09_on_non_default_ports_enabled_(false),
creation_time_(base::TimeTicks::Now()),
weak_factory_(this) {
scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy =
@@ -394,6 +395,13 @@ IOThread::IOThread(
if (value)
value->GetAsBoolean(&is_quic_allowed_by_policy_);
+ value = policy_service
+ ->GetPolicies(policy::PolicyNamespace(
+ policy::POLICY_DOMAIN_CHROME, std::string()))
+ .GetValue(policy::key::kHttp09OnNonDefaultPortsEnabled);
+ if (value)
+ value->GetAsBoolean(&http_09_on_non_default_ports_enabled_);
+
// Some unit tests use IOThread but do not initialize MetricsService. In that
// case it is fine not to have |metrics_data_use_forwarder_|.
if (g_browser_process->metrics_service()) {
@@ -607,7 +615,8 @@ void IOThread::Init() {
net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_tfo_if_supported);
ConfigureParamsFromFieldTrialsAndCommandLine(
- command_line, is_quic_allowed_by_policy_, &params_);
+ command_line, is_quic_allowed_by_policy_,
+ http_09_on_non_default_ports_enabled_, &params_);
TRACE_EVENT_BEGIN0("startup",
"IOThread::Init:ProxyScriptFetcherRequestContext");
@@ -887,6 +896,7 @@ net::URLRequestContext* IOThread::ConstructSystemRequestContext(
void IOThread::ConfigureParamsFromFieldTrialsAndCommandLine(
const base::CommandLine& command_line,
bool is_quic_allowed_by_policy,
+ bool http_09_on_non_default_ports_enabled,
net::HttpNetworkSession::Params* params) {
std::string quic_user_agent_id = chrome::GetChannelString();
if (!quic_user_agent_id.empty())
@@ -983,6 +993,9 @@ void IOThread::ConfigureParamsFromFieldTrialsAndCommandLine(
params->testing_fixed_https_port =
GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort);
}
+
+ params->http_09_on_non_default_ports_enabled =
+ http_09_on_non_default_ports_enabled;
}
// static
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/io_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698