OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 } | 846 } |
847 | 847 |
848 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) | 848 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) |
849 globals_->enable_websocket_over_spdy.set(true); | 849 globals_->enable_websocket_over_spdy.set(true); |
850 } | 850 } |
851 | 851 |
852 // TODO(rch): Make the client socket factory a per-network session | 852 // TODO(rch): Make the client socket factory a per-network session |
853 // instance, constructed from a NetworkSession::Params, to allow us | 853 // instance, constructed from a NetworkSession::Params, to allow us |
854 // to move this option to IOThread::Globals & | 854 // to move this option to IOThread::Globals & |
855 // HttpNetworkSession::Params. | 855 // HttpNetworkSession::Params. |
856 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 856 bool user_enabled_tfo = false; |
mmenke
2014/08/12 15:25:15
"tfo" isn't what I'd call a standard abbreviation.
Jana
2014/08/13 07:33:40
Changed, PTAL.
| |
857 net::SetTCPFastOpenEnabled(true); | 857 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) { |
858 user_enabled_tfo = true; | |
859 } | |
mmenke
2014/08/12 15:25:15
nit: Remove braces.
Jana
2014/08/13 07:33:40
Done.
| |
860 // Checks for OS support of TCP FastOpen, and turns it on for all connections | |
861 // if indicated by user above. | |
862 net::CheckSupportAndMaybeEnableTCPFastOpen(user_enabled_tfo); | |
858 } | 863 } |
859 | 864 |
860 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, | 865 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, |
861 Globals* globals) { | 866 Globals* globals) { |
862 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { | 867 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { |
863 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? | 868 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? |
864 net::HttpStreamFactory::set_spdy_enabled(false); | 869 net::HttpStreamFactory::set_spdy_enabled(false); |
865 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { | 870 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { |
866 // Use the current SPDY default (SPDY/3.1). | 871 // Use the current SPDY default (SPDY/3.1). |
867 globals->next_protos = net::NextProtosSpdy31(); | 872 globals->next_protos = net::NextProtosSpdy31(); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1389 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1394 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1390 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1395 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1391 net::QuicVersion version = supported_versions[i]; | 1396 net::QuicVersion version = supported_versions[i]; |
1392 if (net::QuicVersionToString(version) == quic_version) { | 1397 if (net::QuicVersionToString(version) == quic_version) { |
1393 return version; | 1398 return version; |
1394 } | 1399 } |
1395 } | 1400 } |
1396 | 1401 |
1397 return net::QUIC_VERSION_UNSUPPORTED; | 1402 return net::QUIC_VERSION_UNSUPPORTED; |
1398 } | 1403 } |
OLD | NEW |