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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } | 840 } |
841 | 841 |
842 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) | 842 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) |
843 globals_->enable_websocket_over_spdy.set(true); | 843 globals_->enable_websocket_over_spdy.set(true); |
844 } | 844 } |
845 | 845 |
846 // TODO(rch): Make the client socket factory a per-network session | 846 // TODO(rch): Make the client socket factory a per-network session |
847 // instance, constructed from a NetworkSession::Params, to allow us | 847 // instance, constructed from a NetworkSession::Params, to allow us |
848 // to move this option to IOThread::Globals & | 848 // to move this option to IOThread::Globals & |
849 // HttpNetworkSession::Params. | 849 // HttpNetworkSession::Params. |
850 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 850 |
851 net::SetTCPFastOpenEnabled(true); | 851 bool always_enable_if_supported = |
| 852 command_line.HasSwitch(switches::kEnableTcpFastOpen); |
| 853 // Check for OS support of TCP FastOpen, and turn it on for all connections |
| 854 // if indicated by user. |
| 855 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_if_supported); |
852 } | 856 } |
853 | 857 |
854 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, | 858 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, |
855 Globals* globals) { | 859 Globals* globals) { |
856 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { | 860 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { |
857 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? | 861 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? |
858 net::HttpStreamFactory::set_spdy_enabled(false); | 862 net::HttpStreamFactory::set_spdy_enabled(false); |
859 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { | 863 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { |
860 // Use the current SPDY default (SPDY/3.1). | 864 // Use the current SPDY default (SPDY/3.1). |
861 globals->next_protos = net::NextProtosSpdy31(); | 865 globals->next_protos = net::NextProtosSpdy31(); |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1418 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1415 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1419 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1416 net::QuicVersion version = supported_versions[i]; | 1420 net::QuicVersion version = supported_versions[i]; |
1417 if (net::QuicVersionToString(version) == quic_version) { | 1421 if (net::QuicVersionToString(version) == quic_version) { |
1418 return version; | 1422 return version; |
1419 } | 1423 } |
1420 } | 1424 } |
1421 | 1425 |
1422 return net::QUIC_VERSION_UNSUPPORTED; | 1426 return net::QUIC_VERSION_UNSUPPORTED; |
1423 } | 1427 } |
OLD | NEW |