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

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, 9 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
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 641f8f6a33d337d8e9543302ba8940bee24d7392..5c4e9e9369f5333418a46b8bea628a463074cbf6 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -458,6 +458,7 @@ IOThread::IOThread(
#endif
globals_(NULL),
is_spdy_disabled_by_policy_(false),
+ is_quic_enabled_by_policy_(true),
creation_time_(base::TimeTicks::Now()),
weak_factory_(this) {
auth_schemes_ = local_state->GetString(prefs::kAuthSchemes);
@@ -505,6 +506,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* v = policy_service->GetPolicies(
Andrew T Wilson (Slow) 2015/03/12 17:23:33 remove extra space after =
Andrew T Wilson (Slow) 2015/03/12 17:23:34 Can this policy be changed on the fly, or only on
peletskyi 2015/03/13 12:00:40 Done.
peletskyi 2015/03/13 12:00:40 Done.
peletskyi 2015/03/13 12:00:40 Only on startup
Andrew T Wilson (Slow) 2015/03/13 14:00:51 OK, ideally all new policies would allow changing
peletskyi 2015/03/18 15:42:30 It will be rather complicated. Currently I don't k
+ policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME,
+ std::string())).GetValue(policy::key::kQuicEnabled);
Andrew T Wilson (Slow) 2015/03/12 17:23:33 nit: indent is off
peletskyi 2015/03/13 12:00:40 Done.
+ if (v != nullptr) {
+ v->GetAsBoolean(&is_quic_enabled_by_policy_);
+ }
#endif // ENABLE_CONFIGURATION_POLICY
BrowserThread::SetDelegate(BrowserThread::IO, this);
@@ -1155,7 +1162,8 @@ void IOThread::ConfigureQuic(const base::CommandLine& command_line) {
params.clear();
}
- ConfigureQuicGlobals(command_line, group, params, globals_);
+ ConfigureQuicGlobals(command_line, group, params, is_quic_enabled_by_policy_,
+ globals_);
}
// static
@@ -1163,11 +1171,13 @@ void IOThread::ConfigureQuicGlobals(
const base::CommandLine& command_line,
base::StringPiece quic_trial_group,
const VariationParameters& quic_trial_params,
+ bool quic_enabled_by_policy,
IOThread::Globals* globals) {
- bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group);
+ bool enable_quic = ShouldEnableQuic(command_line,
+ quic_trial_group, quic_enabled_by_policy);
globals->enable_quic.set(enable_quic);
bool enable_quic_for_proxies = ShouldEnableQuicForProxies(command_line,
- quic_trial_group);
+ quic_trial_group, quic_enabled_by_policy);
globals->enable_quic_for_proxies.set(enable_quic_for_proxies);
if (enable_quic) {
globals->quic_always_require_handshake_confirmation.set(
@@ -1239,8 +1249,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_enabled_by_policy) {
Andrew T Wilson (Slow) 2015/03/12 17:23:33 So, I think this should be called "quic_disabled_b
peletskyi 2015/03/13 12:00:40 According to new name this variable is called "qui
+ if (command_line.HasSwitch(switches::kDisableQuic) || !quic_enabled_by_policy)
return false;
if (command_line.HasSwitch(switches::kEnableQuic))
@@ -1252,9 +1263,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) ||
- ShouldEnableQuicForDataReductionProxy();
+ base::StringPiece quic_trial_group,
+ bool quic_enabled_by_policy) {
+ return ShouldEnableQuic(command_line, quic_trial_group,
+ quic_enabled_by_policy) || ShouldEnableQuicForDataReductionProxy();
}
// static

Powered by Google App Engine
This is Rietveld 408576698