| 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/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/metrics/user_metrics.h" | |
| 18 #include "base/prefs/pref_registry_simple.h" | 17 #include "base/prefs/pref_registry_simple.h" |
| 19 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 20 #include "base/profiler/scoped_tracker.h" | 19 #include "base/profiler/scoped_tracker.h" |
| 21 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 22 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 23 #include "base/strings/string_piece.h" | 22 #include "base/strings/string_piece.h" |
| 24 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 26 #include "base/threading/sequenced_worker_pool.h" | 25 #include "base/threading/sequenced_worker_pool.h" |
| 27 #include "base/threading/thread.h" | 26 #include "base/threading/thread.h" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 globals_->enable_spdy_ping_based_connection_checking.set(false); | 990 globals_->enable_spdy_ping_based_connection_checking.set(false); |
| 992 } else if (option == kExclude) { | 991 } else if (option == kExclude) { |
| 993 globals_->forced_spdy_exclusions.insert( | 992 globals_->forced_spdy_exclusions.insert( |
| 994 net::HostPortPair::FromURL(GURL(value))); | 993 net::HostPortPair::FromURL(GURL(value))); |
| 995 } else if (option == kDisableCompression) { | 994 } else if (option == kDisableCompression) { |
| 996 globals_->enable_spdy_compression.set(false); | 995 globals_->enable_spdy_compression.set(false); |
| 997 } else if (option == kDisableAltProtocols) { | 996 } else if (option == kDisableAltProtocols) { |
| 998 globals_->use_alternate_protocols.set(false); | 997 globals_->use_alternate_protocols.set(false); |
| 999 } else if (option == kForceAltProtocols) { | 998 } else if (option == kForceAltProtocols) { |
| 1000 net::AlternateProtocolInfo pair(443, net::NPN_SPDY_3, 1); | 999 net::AlternateProtocolInfo pair(443, net::NPN_SPDY_3, 1); |
| 1001 base::RecordAction(base::UserMetricsAction("Net.ForceAlternateProtocol")); | |
| 1002 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); | 1000 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); |
| 1003 } else if (option == kSingleDomain) { | 1001 } else if (option == kSingleDomain) { |
| 1004 DVLOG(1) << "FORCING SINGLE DOMAIN"; | 1002 DVLOG(1) << "FORCING SINGLE DOMAIN"; |
| 1005 globals_->force_spdy_single_domain.set(true); | 1003 globals_->force_spdy_single_domain.set(true); |
| 1006 } else if (option == kInitialMaxConcurrentStreams) { | 1004 } else if (option == kInitialMaxConcurrentStreams) { |
| 1007 int streams; | 1005 int streams; |
| 1008 if (base::StringToInt(value, &streams)) | 1006 if (base::StringToInt(value, &streams)) |
| 1009 globals_->initial_max_spdy_concurrent_streams.set(streams); | 1007 globals_->initial_max_spdy_concurrent_streams.set(streams); |
| 1010 } else if (option.empty() && it == spdy_options.begin()) { | 1008 } else if (option.empty() && it == spdy_options.begin()) { |
| 1011 continue; | 1009 continue; |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1514 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1517 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1515 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1518 net::QuicVersion version = supported_versions[i]; | 1516 net::QuicVersion version = supported_versions[i]; |
| 1519 if (net::QuicVersionToString(version) == quic_version) { | 1517 if (net::QuicVersionToString(version) == quic_version) { |
| 1520 return version; | 1518 return version; |
| 1521 } | 1519 } |
| 1522 } | 1520 } |
| 1523 | 1521 |
| 1524 return net::QUIC_VERSION_UNSUPPORTED; | 1522 return net::QUIC_VERSION_UNSUPPORTED; |
| 1525 } | 1523 } |
| OLD | NEW |