Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #include "chrome/browser/net/chrome_net_log.h" | 32 #include "chrome/browser/net/chrome_net_log.h" |
| 33 #include "chrome/browser/net/chrome_network_delegate.h" | 33 #include "chrome/browser/net/chrome_network_delegate.h" |
| 34 #include "chrome/browser/net/chrome_url_request_context.h" | 34 #include "chrome/browser/net/chrome_url_request_context.h" |
| 35 #include "chrome/browser/net/connect_interceptor.h" | 35 #include "chrome/browser/net/connect_interceptor.h" |
| 36 #include "chrome/browser/net/dns_probe_service.h" | 36 #include "chrome/browser/net/dns_probe_service.h" |
| 37 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 37 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 38 #include "chrome/browser/net/proxy_service_factory.h" | 38 #include "chrome/browser/net/proxy_service_factory.h" |
| 39 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 39 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 40 #include "chrome/common/chrome_content_client.h" | 40 #include "chrome/common/chrome_content_client.h" |
| 41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/chrome_version_info.h" | 42 #include "chrome/common/chrome_version_info.h" |
|
Lei Zhang
2014/05/31 22:05:54
you can so remove this #include
ramant (doing other things)
2014/06/01 04:50:11
Done.
| |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" | 44 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
| 45 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h" | 45 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti on_proxy.h" |
| 46 #include "components/policy/core/common/policy_service.h" | 46 #include "components/policy/core/common/policy_service.h" |
| 47 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
| 48 #include "content/public/browser/cookie_store_factory.h" | 48 #include "content/public/browser/cookie_store_factory.h" |
| 49 #include "net/base/host_mapping_rules.h" | 49 #include "net/base/host_mapping_rules.h" |
| 50 #include "net/base/net_util.h" | 50 #include "net/base/net_util.h" |
| 51 #include "net/base/sdch_manager.h" | 51 #include "net/base/sdch_manager.h" |
| 52 #include "net/cert/cert_verifier.h" | 52 #include "net/cert/cert_verifier.h" |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1139 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) | 1139 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) |
| 1140 return true; | 1140 return true; |
| 1141 | 1141 |
| 1142 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) | 1142 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) |
| 1143 return false; | 1143 return false; |
| 1144 | 1144 |
| 1145 return quic_trial_group.ends_with( | 1145 return quic_trial_group.ends_with( |
| 1146 kQuicFieldTrialTimeBasedLossDetectionSuffix); | 1146 kQuicFieldTrialTimeBasedLossDetectionSuffix); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 // TODO(rtenneti): Delete this method after the merge. | |
| 1149 bool IOThread::ShouldEnableQuicPersistServerInfo( | 1150 bool IOThread::ShouldEnableQuicPersistServerInfo( |
| 1150 const CommandLine& command_line) { | 1151 const CommandLine& command_line) { |
| 1151 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
| 1152 // Avoid persisting of Quic server config information to disk cache when we | |
| 1153 // have a beta or stable release. Allow in all other cases, including when we | |
| 1154 // do a developer build (CHANNEL_UNKNOWN). | |
| 1155 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | |
| 1156 channel == chrome::VersionInfo::CHANNEL_BETA) { | |
| 1157 return false; | |
| 1158 } | |
| 1159 return true; | 1152 return true; |
| 1160 } | 1153 } |
| 1161 | 1154 |
| 1162 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line, | 1155 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line, |
| 1163 base::StringPiece quic_trial_group) { | 1156 base::StringPiece quic_trial_group) { |
| 1164 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1157 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
| 1165 unsigned value; | 1158 unsigned value; |
| 1166 if (!base::StringToUint( | 1159 if (!base::StringToUint( |
| 1167 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1160 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
| 1168 &value)) { | 1161 &value)) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1200 std::string version_flag = | 1193 std::string version_flag = |
| 1201 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1194 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
| 1202 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1195 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1203 net::QuicVersion version = supported_versions[i]; | 1196 net::QuicVersion version = supported_versions[i]; |
| 1204 if (net::QuicVersionToString(version) == version_flag) { | 1197 if (net::QuicVersionToString(version) == version_flag) { |
| 1205 return version; | 1198 return version; |
| 1206 } | 1199 } |
| 1207 } | 1200 } |
| 1208 return net::QUIC_VERSION_UNSUPPORTED; | 1201 return net::QUIC_VERSION_UNSUPPORTED; |
| 1209 } | 1202 } |
| OLD | NEW |