| 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 15 matching lines...) Expand all Loading... |
| 26 #include "net/http/http_network_layer.h" | 26 #include "net/http/http_network_layer.h" |
| 27 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
| 28 #include "net/http/http_server_properties_impl.h" | 28 #include "net/http/http_server_properties_impl.h" |
| 29 #include "net/http/transport_security_persister.h" | 29 #include "net/http/transport_security_persister.h" |
| 30 #include "net/http/transport_security_state.h" | 30 #include "net/http/transport_security_state.h" |
| 31 #include "net/ssl/channel_id_service.h" | 31 #include "net/ssl/channel_id_service.h" |
| 32 #include "net/ssl/default_channel_id_store.h" | 32 #include "net/ssl/default_channel_id_store.h" |
| 33 #include "net/ssl/ssl_config_service_defaults.h" | 33 #include "net/ssl/ssl_config_service_defaults.h" |
| 34 #include "net/url_request/data_protocol_handler.h" | 34 #include "net/url_request/data_protocol_handler.h" |
| 35 #include "net/url_request/static_http_user_agent_settings.h" | 35 #include "net/url_request/static_http_user_agent_settings.h" |
| 36 #include "net/url_request/url_request_backoff_manager.h" |
| 36 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 37 #include "net/url_request/url_request_context_storage.h" | 38 #include "net/url_request/url_request_context_storage.h" |
| 38 #include "net/url_request/url_request_intercepting_job_factory.h" | 39 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 39 #include "net/url_request/url_request_interceptor.h" | 40 #include "net/url_request/url_request_interceptor.h" |
| 40 #include "net/url_request/url_request_job_factory_impl.h" | 41 #include "net/url_request/url_request_job_factory_impl.h" |
| 41 #include "net/url_request/url_request_throttler_manager.h" | 42 #include "net/url_request/url_request_throttler_manager.h" |
| 42 | 43 |
| 43 #if !defined(DISABLE_FILE_SUPPORT) | 44 #if !defined(DISABLE_FILE_SUPPORT) |
| 44 #include "net/url_request/file_protocol_handler.h" | 45 #include "net/url_request/file_protocol_handler.h" |
| 45 #endif | 46 #endif |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 URLRequestContextBuilder::URLRequestContextBuilder() | 197 URLRequestContextBuilder::URLRequestContextBuilder() |
| 197 : data_enabled_(false), | 198 : data_enabled_(false), |
| 198 #if !defined(DISABLE_FILE_SUPPORT) | 199 #if !defined(DISABLE_FILE_SUPPORT) |
| 199 file_enabled_(false), | 200 file_enabled_(false), |
| 200 #endif | 201 #endif |
| 201 #if !defined(DISABLE_FTP_SUPPORT) | 202 #if !defined(DISABLE_FTP_SUPPORT) |
| 202 ftp_enabled_(false), | 203 ftp_enabled_(false), |
| 203 #endif | 204 #endif |
| 204 http_cache_enabled_(true), | 205 http_cache_enabled_(true), |
| 205 throttling_enabled_(false), | 206 throttling_enabled_(false), |
| 207 backoff_enabled_(false), |
| 206 sdch_enabled_(false) { | 208 sdch_enabled_(false) { |
| 207 } | 209 } |
| 208 | 210 |
| 209 URLRequestContextBuilder::~URLRequestContextBuilder() {} | 211 URLRequestContextBuilder::~URLRequestContextBuilder() {} |
| 210 | 212 |
| 211 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { | 213 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { |
| 212 http_cache_enabled_ = true; | 214 http_cache_enabled_ = true; |
| 213 http_cache_params_ = params; | 215 http_cache_params_ = params; |
| 214 } | 216 } |
| 215 | 217 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 false))); | 328 false))); |
| 327 } | 329 } |
| 328 | 330 |
| 329 storage->set_http_server_properties( | 331 storage->set_http_server_properties( |
| 330 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); | 332 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); |
| 331 storage->set_cert_verifier(CertVerifier::CreateDefault()); | 333 storage->set_cert_verifier(CertVerifier::CreateDefault()); |
| 332 | 334 |
| 333 if (throttling_enabled_) | 335 if (throttling_enabled_) |
| 334 storage->set_throttler_manager(new URLRequestThrottlerManager()); | 336 storage->set_throttler_manager(new URLRequestThrottlerManager()); |
| 335 | 337 |
| 338 if (backoff_enabled_) |
| 339 storage->set_backoff_manager(new URLRequestBackoffManager()); |
| 340 |
| 336 HttpNetworkSession::Params network_session_params; | 341 HttpNetworkSession::Params network_session_params; |
| 337 network_session_params.host_resolver = context->host_resolver(); | 342 network_session_params.host_resolver = context->host_resolver(); |
| 338 network_session_params.cert_verifier = context->cert_verifier(); | 343 network_session_params.cert_verifier = context->cert_verifier(); |
| 339 network_session_params.transport_security_state = | 344 network_session_params.transport_security_state = |
| 340 context->transport_security_state(); | 345 context->transport_security_state(); |
| 341 network_session_params.proxy_service = context->proxy_service(); | 346 network_session_params.proxy_service = context->proxy_service(); |
| 342 network_session_params.ssl_config_service = | 347 network_session_params.ssl_config_service = |
| 343 context->ssl_config_service(); | 348 context->ssl_config_service(); |
| 344 network_session_params.http_auth_handler_factory = | 349 network_session_params.http_auth_handler_factory = |
| 345 context->http_auth_handler_factory(); | 350 context->http_auth_handler_factory(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 426 } |
| 422 url_request_interceptors_.weak_clear(); | 427 url_request_interceptors_.weak_clear(); |
| 423 } | 428 } |
| 424 storage->set_job_factory(top_job_factory.release()); | 429 storage->set_job_factory(top_job_factory.release()); |
| 425 // TODO(willchan): Support sdch. | 430 // TODO(willchan): Support sdch. |
| 426 | 431 |
| 427 return context; | 432 return context; |
| 428 } | 433 } |
| 429 | 434 |
| 430 } // namespace net | 435 } // namespace net |
| OLD | NEW |