blob: e42d46536b0c5e052e51143d654283de0ce3fdf8 [file] [log] [blame]
[email protected]aa84a7e2012-03-15 21:29:061// Copyright (c) 2012 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/host_resolver.h"
[email protected]aa84a7e2012-03-15 21:29:0610#include "net/cookies/cookie_store.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]9c4eff22012-03-20 22:42:2921 server_bound_cert_service_(NULL),
[email protected]b97d7702011-10-16 01:11:0722 fraudulent_certificate_reporter_(NULL),
[email protected]9349cfb2010-08-31 18:00:5323 http_auth_handler_factory_(NULL),
[email protected]160014da2011-05-13 19:37:4624 proxy_service_(NULL),
[email protected]9349cfb2010-08-31 18:00:5325 network_delegate_(NULL),
[email protected]db96a882011-10-09 02:01:5426 http_server_properties_(NULL),
[email protected]70b92342010-10-12 05:54:0627 transport_security_state_(NULL),
[email protected]ede96662011-07-14 12:34:1828 ftp_auth_cache_(new FtpAuthCache),
[email protected]f6c21cb2011-02-16 19:45:4129 http_transaction_factory_(NULL),
[email protected]a8c1e7452011-05-14 06:17:0730 ftp_transaction_factory_(NULL),
31 job_factory_(NULL) {
[email protected]9349cfb2010-08-31 18:00:5332}
[email protected]f1d81922010-07-31 17:47:0933
[email protected]d9696672011-03-15 22:45:0934void URLRequestContext::CopyFrom(URLRequestContext* other) {
35 // Copy URLRequestContext parameters.
[email protected]d9696672011-03-15 22:45:0936 set_net_log(other->net_log());
37 set_host_resolver(other->host_resolver());
38 set_cert_verifier(other->cert_verifier());
[email protected]9c4eff22012-03-20 22:42:2939 set_server_bound_cert_service(other->server_bound_cert_service());
[email protected]b97d7702011-10-16 01:11:0740 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter());
[email protected]d9696672011-03-15 22:45:0941 set_http_auth_handler_factory(other->http_auth_handler_factory());
42 set_proxy_service(other->proxy_service());
43 set_ssl_config_service(other->ssl_config_service());
44 set_network_delegate(other->network_delegate());
[email protected]db96a882011-10-09 02:01:5445 set_http_server_properties(other->http_server_properties());
[email protected]d9696672011-03-15 22:45:0946 set_cookie_store(other->cookie_store());
[email protected]d9696672011-03-15 22:45:0947 set_transport_security_state(other->transport_security_state());
48 // FTPAuthCache is unique per context.
49 set_accept_language(other->accept_language());
50 set_accept_charset(other->accept_charset());
51 set_referrer_charset(other->referrer_charset());
52 set_http_transaction_factory(other->http_transaction_factory());
53 set_ftp_transaction_factory(other->ftp_transaction_factory());
[email protected]a8c1e7452011-05-14 06:17:0754 set_job_factory(other->job_factory());
[email protected]d9696672011-03-15 22:45:0955}
56
[email protected]d100e44f2011-01-26 22:47:1157void URLRequestContext::set_cookie_store(CookieStore* cookie_store) {
58 cookie_store_ = cookie_store;
59}
60
[email protected]f1d81922010-07-31 17:47:0961const std::string& URLRequestContext::GetUserAgent(const GURL& url) const {
62 return EmptyString();
63}
[email protected]9349cfb2010-08-31 18:00:5364
65URLRequestContext::~URLRequestContext() {
66}
[email protected]2fb629202010-12-23 23:52:5767
[email protected]27a112c2011-01-06 04:19:3068} // namespace net