| 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 } | 836 } |
| 837 | 837 |
| 838 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) | 838 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) |
| 839 globals_->enable_websocket_over_spdy.set(true); | 839 globals_->enable_websocket_over_spdy.set(true); |
| 840 } | 840 } |
| 841 | 841 |
| 842 // TODO(rch): Make the client socket factory a per-network session | 842 // TODO(rch): Make the client socket factory a per-network session |
| 843 // instance, constructed from a NetworkSession::Params, to allow us | 843 // instance, constructed from a NetworkSession::Params, to allow us |
| 844 // to move this option to IOThread::Globals & | 844 // to move this option to IOThread::Globals & |
| 845 // HttpNetworkSession::Params. | 845 // HttpNetworkSession::Params. |
| 846 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 846 |
| 847 net::SetTCPFastOpenEnabled(true); | 847 bool always_enable_if_supported = |
| 848 command_line.HasSwitch(switches::kEnableTcpFastOpen); |
| 849 // Check for OS support of TCP FastOpen, and turn it on for all connections |
| 850 // if indicated by user. |
| 851 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_if_supported); |
| 848 } | 852 } |
| 849 | 853 |
| 850 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, | 854 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, |
| 851 Globals* globals) { | 855 Globals* globals) { |
| 852 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { | 856 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { |
| 853 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? | 857 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? |
| 854 net::HttpStreamFactory::set_spdy_enabled(false); | 858 net::HttpStreamFactory::set_spdy_enabled(false); |
| 855 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { | 859 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { |
| 856 // Use the current SPDY default (SPDY/3.1). | 860 // Use the current SPDY default (SPDY/3.1). |
| 857 globals->next_protos = net::NextProtosSpdy31(); | 861 globals->next_protos = net::NextProtosSpdy31(); |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1399 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1396 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1400 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1397 net::QuicVersion version = supported_versions[i]; | 1401 net::QuicVersion version = supported_versions[i]; |
| 1398 if (net::QuicVersionToString(version) == quic_version) { | 1402 if (net::QuicVersionToString(version) == quic_version) { |
| 1399 return version; | 1403 return version; |
| 1400 } | 1404 } |
| 1401 } | 1405 } |
| 1402 | 1406 |
| 1403 return net::QUIC_VERSION_UNSUPPORTED; | 1407 return net::QUIC_VERSION_UNSUPPORTED; |
| 1404 } | 1408 } |
| OLD | NEW |