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