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

Unified Diff: chrome/browser/io_thread.cc

Issue 1124583007: Added QuicAllowed policy. Added unit and browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 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 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 f75340776e030e74ba6aa96fae18bc06f28d43fa..d1908efbb70567dff3bfe5fb617cf822830a2634 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -545,6 +545,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);
@@ -592,6 +593,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);
@@ -1310,7 +1317,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
@@ -1318,11 +1326,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(
@@ -1403,8 +1413,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))
@@ -1416,8 +1427,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