| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 http_cache_params_ = HttpCacheParams(); | 234 http_cache_params_ = HttpCacheParams(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void URLRequestContextBuilder::SetSpdyAndQuicEnabled(bool spdy_enabled, | 237 void URLRequestContextBuilder::SetSpdyAndQuicEnabled(bool spdy_enabled, |
| 238 bool quic_enabled) { | 238 bool quic_enabled) { |
| 239 http_network_session_params_.next_protos = | 239 http_network_session_params_.next_protos = |
| 240 NextProtosWithSpdyAndQuic(spdy_enabled, quic_enabled); | 240 NextProtosWithSpdyAndQuic(spdy_enabled, quic_enabled); |
| 241 http_network_session_params_.enable_quic = quic_enabled; | 241 http_network_session_params_.enable_quic = quic_enabled; |
| 242 } | 242 } |
| 243 | 243 |
| 244 void URLRequestContextBuilder::SetCertVerifier( |
| 245 scoped_ptr<CertVerifier> cert_verifier) { |
| 246 cert_verifier_ = cert_verifier.Pass(); |
| 247 } |
| 248 |
| 244 void URLRequestContextBuilder::SetInterceptors( | 249 void URLRequestContextBuilder::SetInterceptors( |
| 245 ScopedVector<URLRequestInterceptor> url_request_interceptors) { | 250 ScopedVector<URLRequestInterceptor> url_request_interceptors) { |
| 246 url_request_interceptors_ = url_request_interceptors.Pass(); | 251 url_request_interceptors_ = url_request_interceptors.Pass(); |
| 247 } | 252 } |
| 248 | 253 |
| 249 void URLRequestContextBuilder::SetCookieAndChannelIdStores( | 254 void URLRequestContextBuilder::SetCookieAndChannelIdStores( |
| 250 const scoped_refptr<CookieStore>& cookie_store, | 255 const scoped_refptr<CookieStore>& cookie_store, |
| 251 scoped_ptr<ChannelIDService> channel_id_service) { | 256 scoped_ptr<ChannelIDService> channel_id_service) { |
| 252 DCHECK(cookie_store); | 257 DCHECK(cookie_store); |
| 253 cookie_store_ = cookie_store; | 258 cookie_store_ = cookie_store; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 false))); | 349 false))); |
| 345 } | 350 } |
| 346 | 351 |
| 347 if (http_server_properties_) { | 352 if (http_server_properties_) { |
| 348 storage->set_http_server_properties(http_server_properties_.Pass()); | 353 storage->set_http_server_properties(http_server_properties_.Pass()); |
| 349 } else { | 354 } else { |
| 350 storage->set_http_server_properties( | 355 storage->set_http_server_properties( |
| 351 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); | 356 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); |
| 352 } | 357 } |
| 353 | 358 |
| 354 storage->set_cert_verifier(CertVerifier::CreateDefault()); | 359 if (cert_verifier_) { |
| 360 storage->set_cert_verifier(cert_verifier_.Pass()); |
| 361 } else { |
| 362 storage->set_cert_verifier(CertVerifier::CreateDefault()); |
| 363 } |
| 355 | 364 |
| 356 if (throttling_enabled_) { | 365 if (throttling_enabled_) { |
| 357 storage->set_throttler_manager( | 366 storage->set_throttler_manager( |
| 358 make_scoped_ptr(new URLRequestThrottlerManager())); | 367 make_scoped_ptr(new URLRequestThrottlerManager())); |
| 359 } | 368 } |
| 360 | 369 |
| 361 if (backoff_enabled_) { | 370 if (backoff_enabled_) { |
| 362 storage->set_backoff_manager( | 371 storage->set_backoff_manager( |
| 363 make_scoped_ptr(new URLRequestBackoffManager())); | 372 make_scoped_ptr(new URLRequestBackoffManager())); |
| 364 } | 373 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 449 } |
| 441 url_request_interceptors_.weak_clear(); | 450 url_request_interceptors_.weak_clear(); |
| 442 } | 451 } |
| 443 storage->set_job_factory(top_job_factory.Pass()); | 452 storage->set_job_factory(top_job_factory.Pass()); |
| 444 // TODO(willchan): Support sdch. | 453 // TODO(willchan): Support sdch. |
| 445 | 454 |
| 446 return context.Pass(); | 455 return context.Pass(); |
| 447 } | 456 } |
| 448 | 457 |
| 449 } // namespace net | 458 } // namespace net |
| OLD | NEW |