blob: 868532e948a8d2ad9839391c650f0f6bf809420f [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]9349cfb2010-08-31 18:00:5324 http_auth_handler_factory_(NULL),
[email protected]160014da2011-05-13 19:37:4625 proxy_service_(NULL),
[email protected]9349cfb2010-08-31 18:00:5326 network_delegate_(NULL),
[email protected]db96a882011-10-09 02:01:5427 http_server_properties_(NULL),
[email protected]70b92342010-10-12 05:54:0628 transport_security_state_(NULL),
[email protected]ede96662011-07-14 12:34:1829 ftp_auth_cache_(new FtpAuthCache),
[email protected]f6c21cb2011-02-16 19:45:4130 http_transaction_factory_(NULL),
[email protected]a8c1e7452011-05-14 06:17:0731 ftp_transaction_factory_(NULL),
32 job_factory_(NULL) {
[email protected]9349cfb2010-08-31 18:00:5333}
[email protected]f1d81922010-07-31 17:47:0934
[email protected]d9696672011-03-15 22:45:0935void URLRequestContext::CopyFrom(URLRequestContext* other) {
36 // Copy URLRequestContext parameters.
[email protected]d9696672011-03-15 22:45:0937 set_net_log(other->net_log());
38 set_host_resolver(other->host_resolver());
39 set_cert_verifier(other->cert_verifier());
[email protected]feb79bcd2011-07-21 16:55:1740 set_origin_bound_cert_service(other->origin_bound_cert_service());
[email protected]d9696672011-03-15 22:45:0941 set_dnsrr_resolver(other->dnsrr_resolver());
42 set_dns_cert_checker(other->dns_cert_checker());
[email protected]d9696672011-03-15 22:45:0943 set_http_auth_handler_factory(other->http_auth_handler_factory());
44 set_proxy_service(other->proxy_service());
45 set_ssl_config_service(other->ssl_config_service());
46 set_network_delegate(other->network_delegate());
[email protected]db96a882011-10-09 02:01:5447 set_http_server_properties(other->http_server_properties());
[email protected]d9696672011-03-15 22:45:0948 set_cookie_store(other->cookie_store());
[email protected]d9696672011-03-15 22:45:0949 set_transport_security_state(other->transport_security_state());
50 // FTPAuthCache is unique per context.
51 set_accept_language(other->accept_language());
52 set_accept_charset(other->accept_charset());
53 set_referrer_charset(other->referrer_charset());
54 set_http_transaction_factory(other->http_transaction_factory());
55 set_ftp_transaction_factory(other->ftp_transaction_factory());
[email protected]a8c1e7452011-05-14 06:17:0756 set_job_factory(other->job_factory());
[email protected]d9696672011-03-15 22:45:0957}
58
[email protected]d100e44f2011-01-26 22:47:1159void URLRequestContext::set_cookie_store(CookieStore* cookie_store) {
60 cookie_store_ = cookie_store;
61}
62
[email protected]f1d81922010-07-31 17:47:0963const std::string& URLRequestContext::GetUserAgent(const GURL& url) const {
64 return EmptyString();
65}
[email protected]9349cfb2010-08-31 18:00:5366
67URLRequestContext::~URLRequestContext() {
68}
[email protected]2fb629202010-12-23 23:52:5769
[email protected]27a112c2011-01-06 04:19:3070} // namespace net