blob: ccfb56494721d6258dd412a67d0980bfec38a828 [file] [log] [blame]
[email protected]27a112c2011-01-06 04:19:301// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]f1d81922010-07-31 17:47:092// 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]18590f22011-07-29 16:41:287#include "base/compiler_specific.h"
[email protected]f1d81922010-07-31 17:47:098#include "base/string_util.h"
[email protected]9349cfb2010-08-31 18:00:539#include "net/base/cookie_store.h"
10#include "net/base/host_resolver.h"
[email protected]f6c21cb2011-02-16 19:45:4111#include "net/ftp/ftp_transaction_factory.h"
12#include "net/http/http_transaction_factory.h"
[email protected]9349cfb2010-08-31 18:00:5313
[email protected]27a112c2011-01-06 04:19:3014namespace net {
15
[email protected]9349cfb2010-08-31 18:00:5316URLRequestContext::URLRequestContext()
[email protected]18590f22011-07-29 16:41:2817 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
18 net_log_(NULL),
[email protected]c3a7bce2010-10-18 17:36:5419 host_resolver_(NULL),
[email protected]822581d2010-12-16 17:27:1520 cert_verifier_(NULL),
[email protected]feb79bcd2011-07-21 16:55:1721 origin_bound_cert_service_(NULL),
[email protected]2db580532010-10-08 14:32:3722 dnsrr_resolver_(NULL),
[email protected]345c613b2010-11-22 19:33:1823 dns_cert_checker_(NULL),
[email protected]b97d7702011-10-16 01:11:0724 fraudulent_certificate_reporter_(NULL),
[email protected]9349cfb2010-08-31 18:00:5325 http_auth_handler_factory_(NULL),
[email protected]160014da2011-05-13 19:37:4626 proxy_service_(NULL),
[email protected]9349cfb2010-08-31 18:00:5327 network_delegate_(NULL),
[email protected]db96a882011-10-09 02:01:5428 http_server_properties_(NULL),
[email protected]70b92342010-10-12 05:54:0629 transport_security_state_(NULL),
[email protected]ede96662011-07-14 12:34:1830 ftp_auth_cache_(new FtpAuthCache),
[email protected]f6c21cb2011-02-16 19:45:4131 http_transaction_factory_(NULL),
[email protected]a8c1e7452011-05-14 06:17:0732 ftp_transaction_factory_(NULL),
33 job_factory_(NULL) {
[email protected]9349cfb2010-08-31 18:00:5334}
[email protected]f1d81922010-07-31 17:47:0935
[email protected]d9696672011-03-15 22:45:0936void URLRequestContext::CopyFrom(URLRequestContext* other) {
37 // Copy URLRequestContext parameters.
[email protected]d9696672011-03-15 22:45:0938 set_net_log(other->net_log());
39 set_host_resolver(other->host_resolver());
40 set_cert_verifier(other->cert_verifier());
[email protected]feb79bcd2011-07-21 16:55:1741 set_origin_bound_cert_service(other->origin_bound_cert_service());
[email protected]d9696672011-03-15 22:45:0942 set_dnsrr_resolver(other->dnsrr_resolver());
43 set_dns_cert_checker(other->dns_cert_checker());
[email protected]b97d7702011-10-16 01:11:0744 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter());
[email protected]d9696672011-03-15 22:45:0945 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]db96a882011-10-09 02:01:5449 set_http_server_properties(other->http_server_properties());
[email protected]d9696672011-03-15 22:45:0950 set_cookie_store(other->cookie_store());
[email protected]d9696672011-03-15 22:45:0951 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]a8c1e7452011-05-14 06:17:0758 set_job_factory(other->job_factory());
[email protected]d9696672011-03-15 22:45:0959}
60
[email protected]d100e44f2011-01-26 22:47:1161void URLRequestContext::set_cookie_store(CookieStore* cookie_store) {
62 cookie_store_ = cookie_store;
63}
64
[email protected]f1d81922010-07-31 17:47:0965const std::string& URLRequestContext::GetUserAgent(const GURL& url) const {
66 return EmptyString();
67}
[email protected]9349cfb2010-08-31 18:00:5368
69URLRequestContext::~URLRequestContext() {
70}
[email protected]2fb629202010-12-23 23:52:5771
[email protected]27a112c2011-01-06 04:19:3072} // namespace net