[email protected] | 27a112c | 2011-01-06 04:19:30 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | f1d8192 | 2010-07-31 17:47:09 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/url_request/url_request_context.h" |
| 6 | |
[email protected] | 18590f2 | 2011-07-29 16:41:28 | [diff] [blame] | 7 | #include "base/compiler_specific.h" |
[email protected] | f1d8192 | 2010-07-31 17:47:09 | [diff] [blame] | 8 | #include "base/string_util.h" |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 9 | #include "net/base/cookie_store.h" |
| 10 | #include "net/base/host_resolver.h" |
[email protected] | f6c21cb | 2011-02-16 19:45:41 | [diff] [blame] | 11 | #include "net/ftp/ftp_transaction_factory.h" |
| 12 | #include "net/http/http_transaction_factory.h" |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 13 | |
[email protected] | 27a112c | 2011-01-06 04:19:30 | [diff] [blame] | 14 | namespace net { |
| 15 | |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 16 | URLRequestContext::URLRequestContext() |
[email protected] | 18590f2 | 2011-07-29 16:41:28 | [diff] [blame] | 17 | : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 18 | net_log_(NULL), |
[email protected] | c3a7bce | 2010-10-18 17:36:54 | [diff] [blame] | 19 | host_resolver_(NULL), |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 20 | cert_verifier_(NULL), |
[email protected] | feb79bcd | 2011-07-21 16:55:17 | [diff] [blame] | 21 | origin_bound_cert_service_(NULL), |
[email protected] | 2db58053 | 2010-10-08 14:32:37 | [diff] [blame] | 22 | dnsrr_resolver_(NULL), |
[email protected] | 345c613b | 2010-11-22 19:33:18 | [diff] [blame] | 23 | dns_cert_checker_(NULL), |
[email protected] | b97d770 | 2011-10-16 01:11:07 | [diff] [blame^] | 24 | fraudulent_certificate_reporter_(NULL), |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 25 | http_auth_handler_factory_(NULL), |
[email protected] | 160014da | 2011-05-13 19:37:46 | [diff] [blame] | 26 | proxy_service_(NULL), |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 27 | network_delegate_(NULL), |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 28 | http_server_properties_(NULL), |
[email protected] | 70b9234 | 2010-10-12 05:54:06 | [diff] [blame] | 29 | transport_security_state_(NULL), |
[email protected] | ede9666 | 2011-07-14 12:34:18 | [diff] [blame] | 30 | ftp_auth_cache_(new FtpAuthCache), |
[email protected] | f6c21cb | 2011-02-16 19:45:41 | [diff] [blame] | 31 | http_transaction_factory_(NULL), |
[email protected] | a8c1e745 | 2011-05-14 06:17:07 | [diff] [blame] | 32 | ftp_transaction_factory_(NULL), |
| 33 | job_factory_(NULL) { |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 34 | } |
[email protected] | f1d8192 | 2010-07-31 17:47:09 | [diff] [blame] | 35 | |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 36 | void URLRequestContext::CopyFrom(URLRequestContext* other) { |
| 37 | // Copy URLRequestContext parameters. |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 38 | set_net_log(other->net_log()); |
| 39 | set_host_resolver(other->host_resolver()); |
| 40 | set_cert_verifier(other->cert_verifier()); |
[email protected] | feb79bcd | 2011-07-21 16:55:17 | [diff] [blame] | 41 | set_origin_bound_cert_service(other->origin_bound_cert_service()); |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 42 | set_dnsrr_resolver(other->dnsrr_resolver()); |
| 43 | set_dns_cert_checker(other->dns_cert_checker()); |
[email protected] | b97d770 | 2011-10-16 01:11:07 | [diff] [blame^] | 44 | set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter()); |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 45 | set_http_auth_handler_factory(other->http_auth_handler_factory()); |
| 46 | set_proxy_service(other->proxy_service()); |
| 47 | set_ssl_config_service(other->ssl_config_service()); |
| 48 | set_network_delegate(other->network_delegate()); |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 49 | set_http_server_properties(other->http_server_properties()); |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 50 | set_cookie_store(other->cookie_store()); |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 51 | set_transport_security_state(other->transport_security_state()); |
| 52 | // FTPAuthCache is unique per context. |
| 53 | set_accept_language(other->accept_language()); |
| 54 | set_accept_charset(other->accept_charset()); |
| 55 | set_referrer_charset(other->referrer_charset()); |
| 56 | set_http_transaction_factory(other->http_transaction_factory()); |
| 57 | set_ftp_transaction_factory(other->ftp_transaction_factory()); |
[email protected] | a8c1e745 | 2011-05-14 06:17:07 | [diff] [blame] | 58 | set_job_factory(other->job_factory()); |
[email protected] | d969667 | 2011-03-15 22:45:09 | [diff] [blame] | 59 | } |
| 60 | |
[email protected] | d100e44f | 2011-01-26 22:47:11 | [diff] [blame] | 61 | void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
| 62 | cookie_store_ = cookie_store; |
| 63 | } |
| 64 | |
[email protected] | f1d8192 | 2010-07-31 17:47:09 | [diff] [blame] | 65 | const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { |
| 66 | return EmptyString(); |
| 67 | } |
[email protected] | 9349cfb | 2010-08-31 18:00:53 | [diff] [blame] | 68 | |
| 69 | URLRequestContext::~URLRequestContext() { |
| 70 | } |
[email protected] | 2fb62920 | 2010-12-23 23:52:57 | [diff] [blame] | 71 | |
[email protected] | 27a112c | 2011-01-06 04:19:30 | [diff] [blame] | 72 | } // namespace net |