| 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_storage.h" | 5 #include "net/url_request/url_request_context_storage.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/base/network_delegate.h" | 8 #include "net/base/network_delegate.h" |
| 9 #include "net/base/sdch_manager.h" | 9 #include "net/base/sdch_manager.h" |
| 10 #include "net/cert/cert_verifier.h" | 10 #include "net/cert/cert_verifier.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace net { | 26 namespace net { |
| 27 | 27 |
| 28 URLRequestContextStorage::URLRequestContextStorage(URLRequestContext* context) | 28 URLRequestContextStorage::URLRequestContextStorage(URLRequestContext* context) |
| 29 : context_(context) { | 29 : context_(context) { |
| 30 DCHECK(context); | 30 DCHECK(context); |
| 31 } | 31 } |
| 32 | 32 |
| 33 URLRequestContextStorage::~URLRequestContextStorage() {} | 33 URLRequestContextStorage::~URLRequestContextStorage() {} |
| 34 | 34 |
| 35 void URLRequestContextStorage::set_net_log(NetLog* net_log) { | 35 void URLRequestContextStorage::set_net_log(scoped_ptr<NetLog> net_log) { |
| 36 context_->set_net_log(net_log); | 36 context_->set_net_log(net_log.get()); |
| 37 net_log_.reset(net_log); | 37 net_log_ = net_log.Pass(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void URLRequestContextStorage::set_host_resolver( | 40 void URLRequestContextStorage::set_host_resolver( |
| 41 scoped_ptr<HostResolver> host_resolver) { | 41 scoped_ptr<HostResolver> host_resolver) { |
| 42 context_->set_host_resolver(host_resolver.get()); | 42 context_->set_host_resolver(host_resolver.get()); |
| 43 host_resolver_ = host_resolver.Pass(); | 43 host_resolver_ = host_resolver.Pass(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void URLRequestContextStorage::set_cert_verifier(CertVerifier* cert_verifier) { | 46 void URLRequestContextStorage::set_cert_verifier( |
| 47 context_->set_cert_verifier(cert_verifier); | 47 scoped_ptr<CertVerifier> cert_verifier) { |
| 48 cert_verifier_.reset(cert_verifier); | 48 context_->set_cert_verifier(cert_verifier.get()); |
| 49 cert_verifier_ = cert_verifier.Pass(); |
| 49 } | 50 } |
| 50 | 51 |
| 51 void URLRequestContextStorage::set_channel_id_service( | 52 void URLRequestContextStorage::set_channel_id_service( |
| 52 scoped_ptr<ChannelIDService> channel_id_service) { | 53 scoped_ptr<ChannelIDService> channel_id_service) { |
| 53 context_->set_channel_id_service(channel_id_service.get()); | 54 context_->set_channel_id_service(channel_id_service.get()); |
| 54 channel_id_service_ = channel_id_service.Pass(); | 55 channel_id_service_ = channel_id_service.Pass(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 void URLRequestContextStorage::set_http_auth_handler_factory( | 58 void URLRequestContextStorage::set_http_auth_handler_factory( |
| 58 HttpAuthHandlerFactory* http_auth_handler_factory) { | 59 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory) { |
| 59 context_->set_http_auth_handler_factory(http_auth_handler_factory); | 60 context_->set_http_auth_handler_factory(http_auth_handler_factory.get()); |
| 60 http_auth_handler_factory_.reset(http_auth_handler_factory); | 61 http_auth_handler_factory_ = http_auth_handler_factory.Pass(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void URLRequestContextStorage::set_proxy_service(ProxyService* proxy_service) { | 64 void URLRequestContextStorage::set_proxy_service( |
| 64 context_->set_proxy_service(proxy_service); | 65 scoped_ptr<ProxyService> proxy_service) { |
| 65 proxy_service_.reset(proxy_service); | 66 context_->set_proxy_service(proxy_service.get()); |
| 67 proxy_service_ = proxy_service.Pass(); |
| 66 } | 68 } |
| 67 | 69 |
| 68 void URLRequestContextStorage::set_ssl_config_service( | 70 void URLRequestContextStorage::set_ssl_config_service( |
| 69 SSLConfigService* ssl_config_service) { | 71 SSLConfigService* ssl_config_service) { |
| 70 context_->set_ssl_config_service(ssl_config_service); | 72 context_->set_ssl_config_service(ssl_config_service); |
| 71 ssl_config_service_ = ssl_config_service; | 73 ssl_config_service_ = ssl_config_service; |
| 72 } | 74 } |
| 73 | 75 |
| 74 void URLRequestContextStorage::set_network_delegate( | 76 void URLRequestContextStorage::set_network_delegate( |
| 75 NetworkDelegate* network_delegate) { | 77 scoped_ptr<NetworkDelegate> network_delegate) { |
| 76 context_->set_network_delegate(network_delegate); | 78 context_->set_network_delegate(network_delegate.get()); |
| 77 network_delegate_.reset(network_delegate); | 79 network_delegate_ = network_delegate.Pass(); |
| 78 } | 80 } |
| 79 | 81 |
| 80 void URLRequestContextStorage::set_http_server_properties( | 82 void URLRequestContextStorage::set_http_server_properties( |
| 81 scoped_ptr<HttpServerProperties> http_server_properties) { | 83 scoped_ptr<HttpServerProperties> http_server_properties) { |
| 82 http_server_properties_ = http_server_properties.Pass(); | 84 http_server_properties_ = http_server_properties.Pass(); |
| 83 context_->set_http_server_properties(http_server_properties_->GetWeakPtr()); | 85 context_->set_http_server_properties(http_server_properties_->GetWeakPtr()); |
| 84 } | 86 } |
| 85 | 87 |
| 86 void URLRequestContextStorage::set_cookie_store(CookieStore* cookie_store) { | 88 void URLRequestContextStorage::set_cookie_store(CookieStore* cookie_store) { |
| 87 context_->set_cookie_store(cookie_store); | 89 context_->set_cookie_store(cookie_store); |
| 88 cookie_store_ = cookie_store; | 90 cookie_store_ = cookie_store; |
| 89 } | 91 } |
| 90 | 92 |
| 91 void URLRequestContextStorage::set_transport_security_state( | 93 void URLRequestContextStorage::set_transport_security_state( |
| 92 TransportSecurityState* transport_security_state) { | 94 scoped_ptr<TransportSecurityState> transport_security_state) { |
| 93 context_->set_transport_security_state(transport_security_state); | 95 context_->set_transport_security_state(transport_security_state.get()); |
| 94 transport_security_state_.reset(transport_security_state); | 96 transport_security_state_ = transport_security_state.Pass(); |
| 95 } | 97 } |
| 96 | 98 |
| 97 void URLRequestContextStorage::set_http_transaction_factory( | 99 void URLRequestContextStorage::set_http_transaction_factory( |
| 98 HttpTransactionFactory* http_transaction_factory) { | 100 scoped_ptr<HttpTransactionFactory> http_transaction_factory) { |
| 99 context_->set_http_transaction_factory(http_transaction_factory); | 101 context_->set_http_transaction_factory(http_transaction_factory.get()); |
| 100 http_transaction_factory_.reset(http_transaction_factory); | 102 http_transaction_factory_ = http_transaction_factory.Pass(); |
| 101 } | 103 } |
| 102 | 104 |
| 103 void URLRequestContextStorage::set_job_factory( | 105 void URLRequestContextStorage::set_job_factory( |
| 104 URLRequestJobFactory* job_factory) { | 106 scoped_ptr<URLRequestJobFactory> job_factory) { |
| 105 context_->set_job_factory(job_factory); | 107 context_->set_job_factory(job_factory.get()); |
| 106 job_factory_.reset(job_factory); | 108 job_factory_ = job_factory.Pass(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 void URLRequestContextStorage::set_throttler_manager( | 111 void URLRequestContextStorage::set_throttler_manager( |
| 110 URLRequestThrottlerManager* throttler_manager) { | 112 scoped_ptr<URLRequestThrottlerManager> throttler_manager) { |
| 111 context_->set_throttler_manager(throttler_manager); | 113 context_->set_throttler_manager(throttler_manager.get()); |
| 112 throttler_manager_.reset(throttler_manager); | 114 throttler_manager_ = throttler_manager.Pass(); |
| 113 } | 115 } |
| 114 | 116 |
| 115 void URLRequestContextStorage::set_backoff_manager( | 117 void URLRequestContextStorage::set_backoff_manager( |
| 116 URLRequestBackoffManager* backoff_manager) { | 118 scoped_ptr<URLRequestBackoffManager> backoff_manager) { |
| 117 context_->set_backoff_manager(backoff_manager); | 119 context_->set_backoff_manager(backoff_manager.get()); |
| 118 backoff_manager_.reset(backoff_manager); | 120 backoff_manager_ = backoff_manager.Pass(); |
| 119 } | 121 } |
| 120 | 122 |
| 121 void URLRequestContextStorage::set_http_user_agent_settings( | 123 void URLRequestContextStorage::set_http_user_agent_settings( |
| 122 HttpUserAgentSettings* http_user_agent_settings) { | 124 scoped_ptr<HttpUserAgentSettings> http_user_agent_settings) { |
| 123 context_->set_http_user_agent_settings(http_user_agent_settings); | 125 context_->set_http_user_agent_settings(http_user_agent_settings.get()); |
| 124 http_user_agent_settings_.reset(http_user_agent_settings); | 126 http_user_agent_settings_ = http_user_agent_settings.Pass(); |
| 125 } | 127 } |
| 126 | 128 |
| 127 void URLRequestContextStorage::set_sdch_manager( | 129 void URLRequestContextStorage::set_sdch_manager( |
| 128 scoped_ptr<SdchManager> sdch_manager) { | 130 scoped_ptr<SdchManager> sdch_manager) { |
| 129 context_->set_sdch_manager(sdch_manager.get()); | 131 context_->set_sdch_manager(sdch_manager.get()); |
| 130 sdch_manager_ = sdch_manager.Pass(); | 132 sdch_manager_ = sdch_manager.Pass(); |
| 131 } | 133 } |
| 132 | 134 |
| 133 } // namespace net | 135 } // namespace net |
| OLD | NEW |