| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "net/base/cache_type.h" | 15 #include "net/base/cache_type.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "net/base/network_delegate.h" | 17 #include "net/base/network_delegate.h" |
| 18 #include "net/cert/cert_verifier.h" | 18 #include "net/cert/cert_verifier.h" |
| 19 #include "net/cookies/cookie_monster.h" | 19 #include "net/cookies/cookie_monster.h" |
| 20 #include "net/dns/host_resolver.h" | 20 #include "net/dns/host_resolver.h" |
| 21 #include "net/ftp/ftp_network_layer.h" | 21 #include "net/ftp/ftp_network_layer.h" |
| 22 #include "net/http/http_auth_handler_factory.h" | 22 #include "net/http/http_auth_handler_factory.h" |
| 23 #include "net/http/http_cache.h" | 23 #include "net/http/http_cache.h" |
| 24 #include "net/http/http_network_layer.h" | 24 #include "net/http/http_network_layer.h" |
| 25 #include "net/http/http_network_session.h" | 25 #include "net/http/http_network_session.h" |
| 26 #include "net/http/http_server_properties_impl.h" | 26 #include "net/http/http_server_properties_impl.h" |
| 27 #include "net/http/transport_security_persister.h" | 27 #include "net/http/transport_security_persister.h" |
| 28 #include "net/http/transport_security_state.h" | 28 #include "net/http/transport_security_state.h" |
| 29 #include "net/ssl/default_server_bound_cert_store.h" | 29 #include "net/ssl/channel_id_service.h" |
| 30 #include "net/ssl/server_bound_cert_service.h" | 30 #include "net/ssl/default_channel_id_store.h" |
| 31 #include "net/ssl/ssl_config_service_defaults.h" | 31 #include "net/ssl/ssl_config_service_defaults.h" |
| 32 #include "net/url_request/data_protocol_handler.h" | 32 #include "net/url_request/data_protocol_handler.h" |
| 33 #include "net/url_request/static_http_user_agent_settings.h" | 33 #include "net/url_request/static_http_user_agent_settings.h" |
| 34 #include "net/url_request/url_request_context.h" | 34 #include "net/url_request/url_request_context.h" |
| 35 #include "net/url_request/url_request_context_storage.h" | 35 #include "net/url_request/url_request_context_storage.h" |
| 36 #include "net/url_request/url_request_job_factory_impl.h" | 36 #include "net/url_request/url_request_job_factory_impl.h" |
| 37 #include "net/url_request/url_request_throttler_manager.h" | 37 #include "net/url_request/url_request_throttler_manager.h" |
| 38 | 38 |
| 39 #if !defined(DISABLE_FILE_SUPPORT) | 39 #if !defined(DISABLE_FILE_SUPPORT) |
| 40 #include "net/url_request/file_protocol_handler.h" | 40 #include "net/url_request/file_protocol_handler.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { | 291 for (size_t i = 0; i < extra_http_auth_handlers_.size(); ++i) { |
| 292 http_auth_handler_registry_factory->RegisterSchemeFactory( | 292 http_auth_handler_registry_factory->RegisterSchemeFactory( |
| 293 extra_http_auth_handlers_[i].scheme, | 293 extra_http_auth_handlers_[i].scheme, |
| 294 extra_http_auth_handlers_[i].factory); | 294 extra_http_auth_handlers_[i].factory); |
| 295 } | 295 } |
| 296 storage->set_http_auth_handler_factory(http_auth_handler_registry_factory); | 296 storage->set_http_auth_handler_factory(http_auth_handler_registry_factory); |
| 297 storage->set_cookie_store(new CookieMonster(NULL, NULL)); | 297 storage->set_cookie_store(new CookieMonster(NULL, NULL)); |
| 298 | 298 |
| 299 // TODO(mmenke): This always creates a file thread, even when it ends up | 299 // TODO(mmenke): This always creates a file thread, even when it ends up |
| 300 // not being used. Consider lazily creating the thread. | 300 // not being used. Consider lazily creating the thread. |
| 301 storage->set_server_bound_cert_service( | 301 storage->set_channel_id_service( |
| 302 new ServerBoundCertService( | 302 new ChannelIDService( |
| 303 new DefaultServerBoundCertStore(NULL), | 303 new DefaultChannelIDStore(NULL), |
| 304 context->GetFileThread()->message_loop_proxy())); | 304 context->GetFileThread()->message_loop_proxy())); |
| 305 | 305 |
| 306 storage->set_transport_security_state(new net::TransportSecurityState()); | 306 storage->set_transport_security_state(new net::TransportSecurityState()); |
| 307 if (!transport_security_persister_path_.empty()) { | 307 if (!transport_security_persister_path_.empty()) { |
| 308 context->set_transport_security_persister( | 308 context->set_transport_security_persister( |
| 309 make_scoped_ptr<TransportSecurityPersister>( | 309 make_scoped_ptr<TransportSecurityPersister>( |
| 310 new TransportSecurityPersister( | 310 new TransportSecurityPersister( |
| 311 context->transport_security_state(), | 311 context->transport_security_state(), |
| 312 transport_security_persister_path_, | 312 transport_security_persister_path_, |
| 313 context->GetFileThread()->message_loop_proxy(), | 313 context->GetFileThread()->message_loop_proxy(), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 network_session_params.testing_fixed_https_port = | 346 network_session_params.testing_fixed_https_port = |
| 347 http_network_session_params_.testing_fixed_https_port; | 347 http_network_session_params_.testing_fixed_https_port; |
| 348 network_session_params.use_alternate_protocols = | 348 network_session_params.use_alternate_protocols = |
| 349 http_network_session_params_.use_alternate_protocols; | 349 http_network_session_params_.use_alternate_protocols; |
| 350 network_session_params.trusted_spdy_proxy = | 350 network_session_params.trusted_spdy_proxy = |
| 351 http_network_session_params_.trusted_spdy_proxy; | 351 http_network_session_params_.trusted_spdy_proxy; |
| 352 network_session_params.next_protos = http_network_session_params_.next_protos; | 352 network_session_params.next_protos = http_network_session_params_.next_protos; |
| 353 | 353 |
| 354 HttpTransactionFactory* http_transaction_factory = NULL; | 354 HttpTransactionFactory* http_transaction_factory = NULL; |
| 355 if (http_cache_enabled_) { | 355 if (http_cache_enabled_) { |
| 356 network_session_params.server_bound_cert_service = | 356 network_session_params.channel_id_service = |
| 357 context->server_bound_cert_service(); | 357 context->channel_id_service(); |
| 358 HttpCache::BackendFactory* http_cache_backend = NULL; | 358 HttpCache::BackendFactory* http_cache_backend = NULL; |
| 359 if (http_cache_params_.type == HttpCacheParams::DISK) { | 359 if (http_cache_params_.type == HttpCacheParams::DISK) { |
| 360 http_cache_backend = new HttpCache::DefaultBackend( | 360 http_cache_backend = new HttpCache::DefaultBackend( |
| 361 DISK_CACHE, | 361 DISK_CACHE, |
| 362 net::CACHE_BACKEND_DEFAULT, | 362 net::CACHE_BACKEND_DEFAULT, |
| 363 http_cache_params_.path, | 363 http_cache_params_.path, |
| 364 http_cache_params_.max_size, | 364 http_cache_params_.max_size, |
| 365 context->GetCacheThread()->message_loop_proxy().get()); | 365 context->GetCacheThread()->message_loop_proxy().get()); |
| 366 } else { | 366 } else { |
| 367 http_cache_backend = | 367 http_cache_backend = |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 #endif // !defined(DISABLE_FTP_SUPPORT) | 400 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 401 | 401 |
| 402 storage->set_job_factory(job_factory); | 402 storage->set_job_factory(job_factory); |
| 403 | 403 |
| 404 // TODO(willchan): Support sdch. | 404 // TODO(willchan): Support sdch. |
| 405 | 405 |
| 406 return context; | 406 return context; |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace net | 409 } // namespace net |
| OLD | NEW |