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 "net/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 max_size(0) {} | 178 max_size(0) {} |
179 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {} | 179 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {} |
180 | 180 |
181 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams() | 181 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams() |
182 : ignore_certificate_errors(false), | 182 : ignore_certificate_errors(false), |
183 host_mapping_rules(NULL), | 183 host_mapping_rules(NULL), |
184 testing_fixed_http_port(0), | 184 testing_fixed_http_port(0), |
185 testing_fixed_https_port(0), | 185 testing_fixed_https_port(0), |
186 next_protos(NextProtosDefaults()), | 186 next_protos(NextProtosDefaults()), |
187 use_alternate_protocols(true), | 187 use_alternate_protocols(true), |
188 enable_quic(false) { | 188 enable_quic(false), |
| 189 enable_quic_for_proxies(false) { |
189 } | 190 } |
190 | 191 |
191 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams() | 192 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams() |
192 {} | 193 {} |
193 | 194 |
194 URLRequestContextBuilder::SchemeFactory::SchemeFactory( | 195 URLRequestContextBuilder::SchemeFactory::SchemeFactory( |
195 const std::string& auth_scheme, | 196 const std::string& auth_scheme, |
196 net::HttpAuthHandlerFactory* auth_handler_factory) | 197 net::HttpAuthHandlerFactory* auth_handler_factory) |
197 : scheme(auth_scheme), factory(auth_handler_factory) { | 198 : scheme(auth_scheme), factory(auth_handler_factory) { |
198 } | 199 } |
(...skipping 18 matching lines...) Expand all Loading... |
217 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { | 218 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { |
218 http_cache_enabled_ = true; | 219 http_cache_enabled_ = true; |
219 http_cache_params_ = params; | 220 http_cache_params_ = params; |
220 } | 221 } |
221 | 222 |
222 void URLRequestContextBuilder::DisableHttpCache() { | 223 void URLRequestContextBuilder::DisableHttpCache() { |
223 http_cache_enabled_ = false; | 224 http_cache_enabled_ = false; |
224 http_cache_params_ = HttpCacheParams(); | 225 http_cache_params_ = HttpCacheParams(); |
225 } | 226 } |
226 | 227 |
227 void URLRequestContextBuilder::SetSpdyAndQuicEnabled(bool spdy_enabled, | 228 void URLRequestContextBuilder::SetSpdyAndQuicEnabled( |
228 bool quic_enabled) { | 229 bool spdy_enabled, |
| 230 bool quic_enabled, |
| 231 bool quic_enabled_for_proxies) { |
229 http_network_session_params_.next_protos = | 232 http_network_session_params_.next_protos = |
230 NextProtosWithSpdyAndQuic(spdy_enabled, quic_enabled); | 233 NextProtosWithSpdyAndQuic(spdy_enabled, quic_enabled); |
231 http_network_session_params_.enable_quic = quic_enabled; | 234 http_network_session_params_.enable_quic = quic_enabled; |
| 235 http_network_session_params_.enable_quic_for_proxies = |
| 236 quic_enabled_for_proxies; |
232 } | 237 } |
233 | 238 |
234 void URLRequestContextBuilder::SetCookieAndChannelIdStores( | 239 void URLRequestContextBuilder::SetCookieAndChannelIdStores( |
235 const scoped_refptr<CookieStore>& cookie_store, | 240 const scoped_refptr<CookieStore>& cookie_store, |
236 scoped_ptr<ChannelIDService> channel_id_service) { | 241 scoped_ptr<ChannelIDService> channel_id_service) { |
237 DCHECK(cookie_store); | 242 DCHECK(cookie_store); |
238 cookie_store_ = cookie_store; | 243 cookie_store_ = cookie_store; |
239 channel_id_service_ = channel_id_service.Pass(); | 244 channel_id_service_ = channel_id_service.Pass(); |
240 } | 245 } |
241 | 246 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 network_session_params.testing_fixed_http_port = | 356 network_session_params.testing_fixed_http_port = |
352 http_network_session_params_.testing_fixed_http_port; | 357 http_network_session_params_.testing_fixed_http_port; |
353 network_session_params.testing_fixed_https_port = | 358 network_session_params.testing_fixed_https_port = |
354 http_network_session_params_.testing_fixed_https_port; | 359 http_network_session_params_.testing_fixed_https_port; |
355 network_session_params.use_alternate_protocols = | 360 network_session_params.use_alternate_protocols = |
356 http_network_session_params_.use_alternate_protocols; | 361 http_network_session_params_.use_alternate_protocols; |
357 network_session_params.trusted_spdy_proxy = | 362 network_session_params.trusted_spdy_proxy = |
358 http_network_session_params_.trusted_spdy_proxy; | 363 http_network_session_params_.trusted_spdy_proxy; |
359 network_session_params.next_protos = http_network_session_params_.next_protos; | 364 network_session_params.next_protos = http_network_session_params_.next_protos; |
360 network_session_params.enable_quic = http_network_session_params_.enable_quic; | 365 network_session_params.enable_quic = http_network_session_params_.enable_quic; |
| 366 network_session_params.enable_quic_for_proxies = |
| 367 http_network_session_params_.enable_quic_for_proxies; |
361 network_session_params.quic_connection_options = | 368 network_session_params.quic_connection_options = |
362 http_network_session_params_.quic_connection_options; | 369 http_network_session_params_.quic_connection_options; |
363 | 370 |
364 HttpTransactionFactory* http_transaction_factory = NULL; | 371 HttpTransactionFactory* http_transaction_factory = NULL; |
365 if (http_cache_enabled_) { | 372 if (http_cache_enabled_) { |
366 network_session_params.channel_id_service = | 373 network_session_params.channel_id_service = |
367 context->channel_id_service(); | 374 context->channel_id_service(); |
368 HttpCache::BackendFactory* http_cache_backend = NULL; | 375 HttpCache::BackendFactory* http_cache_backend = NULL; |
369 if (http_cache_params_.type == HttpCacheParams::DISK) { | 376 if (http_cache_params_.type == HttpCacheParams::DISK) { |
370 http_cache_backend = new HttpCache::DefaultBackend( | 377 http_cache_backend = new HttpCache::DefaultBackend( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 #endif // !defined(DISABLE_FTP_SUPPORT) | 417 #endif // !defined(DISABLE_FTP_SUPPORT) |
411 | 418 |
412 storage->set_job_factory(job_factory); | 419 storage->set_job_factory(job_factory); |
413 | 420 |
414 // TODO(willchan): Support sdch. | 421 // TODO(willchan): Support sdch. |
415 | 422 |
416 return context; | 423 return context; |
417 } | 424 } |
418 | 425 |
419 } // namespace net | 426 } // namespace net |
OLD | NEW |