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

Unified Diff: chrome/browser/io_thread.cc

Issue 998383002: Created policy QuicAllowed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 34fe6b88f55660e46a3825624e5e9534e4297f89..2f8aaf1c2cfc39ca44f9a15897745bf9f7b010e6 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -521,6 +521,7 @@ IOThread::IOThread(
#endif
globals_(NULL),
is_spdy_disabled_by_policy_(false),
+ is_quic_allowed_by_policy_(true),
creation_time_(base::TimeTicks::Now()),
weak_factory_(this) {
auth_schemes_ = local_state->GetString(prefs::kAuthSchemes);
@@ -567,6 +568,12 @@ IOThread::IOThread(
is_spdy_disabled_by_policy_ = policy_service->GetPolicies(
policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string())).Get(
policy::key::kDisableSpdy) != NULL;
+
+ const base::Value* value = policy_service->GetPolicies(
+ policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME,
+ std::string())).GetValue(policy::key::kQuicAllowed);
+ if (value)
+ value->GetAsBoolean(&is_quic_allowed_by_policy_);
#endif // ENABLE_CONFIGURATION_POLICY
BrowserThread::SetDelegate(BrowserThread::IO, this);
@@ -1306,7 +1313,8 @@ void IOThread::ConfigureQuic(const base::CommandLine& command_line) {
params.clear();
}
- ConfigureQuicGlobals(command_line, group, params, globals_);
+ ConfigureQuicGlobals(command_line, group, params, is_quic_allowed_by_policy_,
+ globals_);
}
// static
@@ -1314,11 +1322,13 @@ void IOThread::ConfigureQuicGlobals(
const base::CommandLine& command_line,
base::StringPiece quic_trial_group,
const VariationParameters& quic_trial_params,
+ bool quic_allowed_by_policy,
IOThread::Globals* globals) {
- bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group);
+ bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group,
+ quic_allowed_by_policy);
globals->enable_quic.set(enable_quic);
- bool enable_quic_for_proxies = ShouldEnableQuicForProxies(command_line,
- quic_trial_group);
+ bool enable_quic_for_proxies = ShouldEnableQuicForProxies(
+ command_line, quic_trial_group, quic_allowed_by_policy);
globals->enable_quic_for_proxies.set(enable_quic_for_proxies);
if (enable_quic) {
globals->quic_always_require_handshake_confirmation.set(
@@ -1399,8 +1409,9 @@ void IOThread::ConfigureQuicGlobals(
}
bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line,
- base::StringPiece quic_trial_group) {
- if (command_line.HasSwitch(switches::kDisableQuic))
+ base::StringPiece quic_trial_group,
+ bool quic_allowed_by_policy) {
+ if (command_line.HasSwitch(switches::kDisableQuic) || !quic_allowed_by_policy)
return false;
if (command_line.HasSwitch(switches::kEnableQuic))
@@ -1412,8 +1423,10 @@ bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line,
// static
bool IOThread::ShouldEnableQuicForProxies(const base::CommandLine& command_line,
- base::StringPiece quic_trial_group) {
- return ShouldEnableQuic(command_line, quic_trial_group) ||
+ base::StringPiece quic_trial_group,
+ bool quic_allowed_by_policy) {
+ return ShouldEnableQuic(
+ command_line, quic_trial_group, quic_allowed_by_policy) ||
ShouldEnableQuicForDataReductionProxy();
}
« 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