| 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" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/debug/leak_tracker.h" | 14 #include "base/debug/leak_tracker.h" |
| 15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
| 18 #include "base/metrics/user_metrics.h" |
| 18 #include "base/prefs/pref_registry_simple.h" | 19 #include "base/prefs/pref_registry_simple.h" |
| 19 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
| 20 #include "base/stl_util.h" | 21 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_piece.h" | 23 #include "base/strings/string_piece.h" |
| 23 #include "base/strings/string_split.h" | 24 #include "base/strings/string_split.h" |
| 24 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
| 25 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
| 26 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
| 27 #include "base/threading/worker_pool.h" | 28 #include "base/threading/worker_pool.h" |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 globals_->enable_spdy_ping_based_connection_checking.set(false); | 903 globals_->enable_spdy_ping_based_connection_checking.set(false); |
| 903 } else if (option == kExclude) { | 904 } else if (option == kExclude) { |
| 904 globals_->forced_spdy_exclusions.insert( | 905 globals_->forced_spdy_exclusions.insert( |
| 905 net::HostPortPair::FromURL(GURL(value))); | 906 net::HostPortPair::FromURL(GURL(value))); |
| 906 } else if (option == kDisableCompression) { | 907 } else if (option == kDisableCompression) { |
| 907 globals_->enable_spdy_compression.set(false); | 908 globals_->enable_spdy_compression.set(false); |
| 908 } else if (option == kDisableAltProtocols) { | 909 } else if (option == kDisableAltProtocols) { |
| 909 globals_->use_alternate_protocols.set(false); | 910 globals_->use_alternate_protocols.set(false); |
| 910 } else if (option == kForceAltProtocols) { | 911 } else if (option == kForceAltProtocols) { |
| 911 net::AlternateProtocolInfo pair(443, net::NPN_SPDY_3, 1); | 912 net::AlternateProtocolInfo pair(443, net::NPN_SPDY_3, 1); |
| 913 base::RecordAction(base::UserMetricsAction("Net.ForceAlternateProtocol")); |
| 912 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); | 914 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); |
| 913 } else if (option == kSingleDomain) { | 915 } else if (option == kSingleDomain) { |
| 914 DVLOG(1) << "FORCING SINGLE DOMAIN"; | 916 DVLOG(1) << "FORCING SINGLE DOMAIN"; |
| 915 globals_->force_spdy_single_domain.set(true); | 917 globals_->force_spdy_single_domain.set(true); |
| 916 } else if (option == kInitialMaxConcurrentStreams) { | 918 } else if (option == kInitialMaxConcurrentStreams) { |
| 917 int streams; | 919 int streams; |
| 918 if (base::StringToInt(value, &streams)) | 920 if (base::StringToInt(value, &streams)) |
| 919 globals_->initial_max_spdy_concurrent_streams.set(streams); | 921 globals_->initial_max_spdy_concurrent_streams.set(streams); |
| 920 } else if (option.empty() && it == spdy_options.begin()) { | 922 } else if (option.empty() && it == spdy_options.begin()) { |
| 921 continue; | 923 continue; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1385 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1387 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1386 net::QuicVersion version = supported_versions[i]; | 1388 net::QuicVersion version = supported_versions[i]; |
| 1387 if (net::QuicVersionToString(version) == quic_version) { | 1389 if (net::QuicVersionToString(version) == quic_version) { |
| 1388 return version; | 1390 return version; |
| 1389 } | 1391 } |
| 1390 } | 1392 } |
| 1391 | 1393 |
| 1392 return net::QUIC_VERSION_UNSUPPORTED; | 1394 return net::QUIC_VERSION_UNSUPPORTED; |
| 1393 } | 1395 } |
| OLD | NEW |