Home | History | Annotate | Download | only in url_request
      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
      3 // found in the LICENSE file.
      4 
      5 #include "net/url_request/url_request_context_storage.h"
      6 
      7 #include "base/logging.h"
      8 #include "net/base/cert_verifier.h"
      9 #include "net/base/cookie_policy.h"
     10 #include "net/base/cookie_store.h"
     11 #include "net/base/dnsrr_resolver.h"
     12 #include "net/base/host_resolver.h"
     13 #include "net/base/net_log.h"
     14 #include "net/base/network_delegate.h"
     15 #include "net/ftp/ftp_transaction_factory.h"
     16 #include "net/http/http_auth_handler_factory.h"
     17 #include "net/http/http_transaction_factory.h"
     18 #include "net/proxy/proxy_service.h"
     19 #include "net/url_request/url_request_context.h"
     20 
     21 namespace net {
     22 
     23 URLRequestContextStorage::URLRequestContextStorage(URLRequestContext* context)
     24     : context_(context) {
     25   DCHECK(context);
     26 }
     27 
     28 URLRequestContextStorage::~URLRequestContextStorage() {}
     29 
     30 void URLRequestContextStorage::set_net_log(NetLog* net_log) {
     31   context_->set_net_log(net_log);
     32   net_log_.reset(net_log);
     33 }
     34 
     35 void URLRequestContextStorage::set_host_resolver(HostResolver* host_resolver) {
     36   context_->set_host_resolver(host_resolver);
     37   host_resolver_.reset(host_resolver);
     38 }
     39 
     40 void URLRequestContextStorage::set_cert_verifier(CertVerifier* cert_verifier) {
     41   context_->set_cert_verifier(cert_verifier);
     42   cert_verifier_.reset(cert_verifier);
     43 }
     44 
     45 void URLRequestContextStorage::set_dnsrr_resolver(
     46     DnsRRResolver* dnsrr_resolver) {
     47   context_->set_dnsrr_resolver(dnsrr_resolver);
     48   dnsrr_resolver_.reset(dnsrr_resolver);
     49 }
     50 
     51 void URLRequestContextStorage::set_dns_cert_checker(
     52     DnsCertProvenanceChecker* dns_cert_checker) {
     53   context_->set_dns_cert_checker(dns_cert_checker);
     54   dns_cert_checker_.reset(dns_cert_checker);
     55 }
     56 
     57 void URLRequestContextStorage::set_http_auth_handler_factory(
     58     HttpAuthHandlerFactory* http_auth_handler_factory) {
     59   context_->set_http_auth_handler_factory(http_auth_handler_factory);
     60   http_auth_handler_factory_.reset(http_auth_handler_factory);
     61 }
     62 
     63 void URLRequestContextStorage::set_proxy_service(ProxyService* proxy_service) {
     64   context_->set_proxy_service(proxy_service);
     65   proxy_service_ = proxy_service;
     66 }
     67 
     68 void URLRequestContextStorage::set_ssl_config_service(
     69     SSLConfigService* ssl_config_service) {
     70   context_->set_ssl_config_service(ssl_config_service);
     71   ssl_config_service_ = ssl_config_service;
     72 }
     73 
     74 void URLRequestContextStorage::set_network_delegate(
     75     NetworkDelegate* network_delegate) {
     76   context_->set_network_delegate(network_delegate);
     77   network_delegate_.reset(network_delegate);
     78 }
     79 
     80 void URLRequestContextStorage::set_cookie_store(CookieStore* cookie_store) {
     81   context_->set_cookie_store(cookie_store);
     82   cookie_store_ = cookie_store;
     83 }
     84 
     85 void URLRequestContextStorage::set_cookie_policy(CookiePolicy* cookie_policy) {
     86   context_->set_cookie_policy(cookie_policy);
     87   cookie_policy_.reset(cookie_policy);
     88 }
     89 
     90 void URLRequestContextStorage::set_transport_security_state(
     91     TransportSecurityState* transport_security_state) {
     92   context_->set_transport_security_state(transport_security_state);
     93   transport_security_state_ = transport_security_state;
     94 }
     95 
     96 void URLRequestContextStorage::set_http_transaction_factory(
     97     HttpTransactionFactory* http_transaction_factory) {
     98   context_->set_http_transaction_factory(http_transaction_factory);
     99   http_transaction_factory_.reset(http_transaction_factory);
    100 }
    101 
    102 void URLRequestContextStorage::set_ftp_transaction_factory(
    103     FtpTransactionFactory* ftp_transaction_factory) {
    104   context_->set_ftp_transaction_factory(ftp_transaction_factory);
    105   ftp_transaction_factory_.reset(ftp_transaction_factory);
    106 }
    107 
    108 }  // namespace net
    109