OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "net/url_request/url_request_context.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "net/base/cookie_store.h" | 8 #include "net/base/cookie_store.h" |
9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
10 #include "net/ftp/ftp_transaction_factory.h" | 10 #include "net/ftp/ftp_transaction_factory.h" |
11 #include "net/http/http_transaction_factory.h" | 11 #include "net/http/http_transaction_factory.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 URLRequestContext::URLRequestContext() | 15 URLRequestContext::URLRequestContext() |
16 : is_main_(false), | 16 : is_main_(false), |
17 net_log_(NULL), | 17 net_log_(NULL), |
18 host_resolver_(NULL), | 18 host_resolver_(NULL), |
19 cert_verifier_(NULL), | 19 cert_verifier_(NULL), |
20 dnsrr_resolver_(NULL), | 20 dnsrr_resolver_(NULL), |
21 dns_cert_checker_(NULL), | 21 dns_cert_checker_(NULL), |
22 http_auth_handler_factory_(NULL), | 22 http_auth_handler_factory_(NULL), |
23 network_delegate_(NULL), | 23 network_delegate_(NULL), |
24 cookie_policy_(NULL), | 24 cookie_policy_(NULL), |
25 transport_security_state_(NULL), | 25 transport_security_state_(NULL), |
26 http_transaction_factory_(NULL), | 26 http_transaction_factory_(NULL), |
27 ftp_transaction_factory_(NULL) { | 27 ftp_transaction_factory_(NULL) { |
28 } | 28 } |
29 | 29 |
| 30 void URLRequestContext::CopyFrom(URLRequestContext* other) { |
| 31 // Copy URLRequestContext parameters. |
| 32 // Do not copy is_main_. |
| 33 set_net_log(other->net_log()); |
| 34 set_host_resolver(other->host_resolver()); |
| 35 set_cert_verifier(other->cert_verifier()); |
| 36 set_dnsrr_resolver(other->dnsrr_resolver()); |
| 37 set_dns_cert_checker(other->dns_cert_checker()); |
| 38 set_http_auth_handler_factory(other->http_auth_handler_factory()); |
| 39 set_proxy_service(other->proxy_service()); |
| 40 set_ssl_config_service(other->ssl_config_service()); |
| 41 set_network_delegate(other->network_delegate()); |
| 42 set_cookie_store(other->cookie_store()); |
| 43 set_cookie_policy(other->cookie_policy()); |
| 44 set_transport_security_state(other->transport_security_state()); |
| 45 // FTPAuthCache is unique per context. |
| 46 set_accept_language(other->accept_language()); |
| 47 set_accept_charset(other->accept_charset()); |
| 48 set_referrer_charset(other->referrer_charset()); |
| 49 set_http_transaction_factory(other->http_transaction_factory()); |
| 50 set_ftp_transaction_factory(other->ftp_transaction_factory()); |
| 51 } |
| 52 |
30 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 53 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
31 cookie_store_ = cookie_store; | 54 cookie_store_ = cookie_store; |
32 } | 55 } |
33 | 56 |
34 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { | 57 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { |
35 return EmptyString(); | 58 return EmptyString(); |
36 } | 59 } |
37 | 60 |
38 URLRequestContext::~URLRequestContext() { | 61 URLRequestContext::~URLRequestContext() { |
39 } | 62 } |
40 | 63 |
41 } // namespace net | 64 } // namespace net |
OLD | NEW |