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

Unified Diff: chrome/browser/io_thread.cc

Issue 903213003: Enable QUIC for proxies based on Finch config and command line switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 5 years, 10 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 41d8709c78e96ec25425124e14cce21aea230a9f..72a745b66e1fb87b5d77f2577e4dca699e46a4e1 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -42,6 +42,7 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/policy/core/common/policy_service.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/browser/browser_thread.h"
@@ -1039,6 +1040,7 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals(
&params->alternate_protocol_probability_threshold);
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(
&params->quic_always_require_handshake_confirmation);
globals.quic_disable_connection_pooling.CopyToIfSet(
@@ -1168,6 +1170,9 @@ void IOThread::ConfigureQuicGlobals(
IOThread::Globals* globals) {
bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group);
globals->enable_quic.set(enable_quic);
+ bool enable_quic_for_proxies = ShouldEnableQuicForProxies(command_line,
+ quic_trial_group);
+ globals->enable_quic_for_proxies.set(enable_quic_for_proxies);
if (enable_quic) {
globals->quic_always_require_handshake_confirmation.set(
ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params));
@@ -1249,6 +1254,25 @@ bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line,
quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName);
}
+// static
+bool IOThread::ShouldEnableQuicForProxies(const base::CommandLine& command_line,
+ base::StringPiece quic_trial_group) {
+ return ShouldEnableQuic(command_line, quic_trial_group) ||
+ ShouldEnableQuicForDataReductionProxy();
+}
+
+// static
+bool IOThread::ShouldEnableQuicForDataReductionProxy() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableQuic))
+ return false;
+
+ return data_reduction_proxy::DataReductionProxyParams::
+ IsIncludedInQuicFieldTrial();
+}
+
bool IOThread::ShouldEnableQuicPortSelection(
const base::CommandLine& command_line) {
if (command_line.HasSwitch(switches::kDisableQuicPortSelection))
« 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