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

Unified Diff: chrome/browser/io_thread.cc

Issue 1431723002: Add brotli content-encoding filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add brotli reference link Created 5 years, 1 month 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 35ed57e46105cec561116b820744ba8a09afa885..d07ac7ce1b9dfc3ab6668827738f69441751d50e 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -813,6 +813,7 @@ void IOThread::Init() {
switches::kEnableUserAlternateProtocolPorts)) {
globals_->enable_user_alternate_protocol_ports = true;
}
+ globals_->enable_brotli.set(ShouldEnableBrotli(command_line));
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.
tracked_objects::ScopedTracker tracking_profile13(
@@ -1087,6 +1088,8 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals(
globals.enable_npn.CopyToIfSet(&params->enable_npn);
+ globals.enable_brotli.CopyToIfSet(&params->enable_brotli);
+
globals.enable_quic.CopyToIfSet(&params->enable_quic);
globals.enable_quic_for_proxies.CopyToIfSet(&params->enable_quic_for_proxies);
globals.quic_always_require_handshake_confirmation.CopyToIfSet(
@@ -1295,6 +1298,12 @@ void IOThread::ConfigureQuicGlobals(
}
}
+bool IOThread::ShouldEnableBrotli(const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kDisableBrotli))
+ return false;
+ return command_line.HasSwitch(switches::kEnableBrotli);
xunjieli 2015/11/17 16:16:12 Why do we have both the enable and disable switche
eustas 2015/11/17 17:57:20 This makes rolling out feature easier. User have c
+}
+
bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line,
base::StringPiece quic_trial_group,
bool quic_allowed_by_policy) {

Powered by Google App Engine
This is Rietveld 408576698