| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/url_request_context.h" | 5 #include "net/url_request/url_request_context.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/debug/alias.h" | 8 #include "base/debug/alias.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "net/base/host_resolver.h" | 10 #include "net/base/host_resolver.h" |
| 11 #include "net/cookies/cookie_store.h" | 11 #include "net/cookies/cookie_store.h" |
| 12 #include "net/ftp/ftp_transaction_factory.h" | 12 #include "net/ftp/ftp_transaction_factory.h" |
| 13 #include "net/http/http_transaction_factory.h" | 13 #include "net/http/http_transaction_factory.h" |
| 14 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 URLRequestContext::URLRequestContext() | 18 URLRequestContext::URLRequestContext() |
| 19 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 19 : net_log_(NULL), |
| 20 net_log_(NULL), | |
| 21 host_resolver_(NULL), | 20 host_resolver_(NULL), |
| 22 cert_verifier_(NULL), | 21 cert_verifier_(NULL), |
| 23 server_bound_cert_service_(NULL), | 22 server_bound_cert_service_(NULL), |
| 24 fraudulent_certificate_reporter_(NULL), | 23 fraudulent_certificate_reporter_(NULL), |
| 25 http_auth_handler_factory_(NULL), | 24 http_auth_handler_factory_(NULL), |
| 26 proxy_service_(NULL), | 25 proxy_service_(NULL), |
| 27 network_delegate_(NULL), | 26 network_delegate_(NULL), |
| 28 http_server_properties_(NULL), | 27 http_server_properties_(NULL), |
| 29 transport_security_state_(NULL), | 28 transport_security_state_(NULL), |
| 30 ftp_auth_cache_(new FtpAuthCache), | 29 ftp_auth_cache_(new FtpAuthCache), |
| 31 http_transaction_factory_(NULL), | 30 http_transaction_factory_(NULL), |
| 32 ftp_transaction_factory_(NULL), | 31 ftp_transaction_factory_(NULL), |
| 33 job_factory_(NULL), | 32 job_factory_(NULL), |
| 34 throttler_manager_(NULL), | 33 throttler_manager_(NULL), |
| 35 url_requests_(new std::set<const URLRequest*>) { | 34 url_requests_(new std::set<const URLRequest*>) { |
| 36 } | 35 } |
| 37 | 36 |
| 37 URLRequestContext::~URLRequestContext() { |
| 38 AssertNoURLRequests(); |
| 39 } |
| 40 |
| 38 void URLRequestContext::CopyFrom(URLRequestContext* other) { | 41 void URLRequestContext::CopyFrom(URLRequestContext* other) { |
| 39 // Copy URLRequestContext parameters. | 42 // Copy URLRequestContext parameters. |
| 40 set_net_log(other->net_log()); | 43 set_net_log(other->net_log()); |
| 41 set_host_resolver(other->host_resolver()); | 44 set_host_resolver(other->host_resolver()); |
| 42 set_cert_verifier(other->cert_verifier()); | 45 set_cert_verifier(other->cert_verifier()); |
| 43 set_server_bound_cert_service(other->server_bound_cert_service()); | 46 set_server_bound_cert_service(other->server_bound_cert_service()); |
| 44 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter()); | 47 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter()); |
| 45 set_http_auth_handler_factory(other->http_auth_handler_factory()); | 48 set_http_auth_handler_factory(other->http_auth_handler_factory()); |
| 46 set_proxy_service(other->proxy_service()); | 49 set_proxy_service(other->proxy_service()); |
| 47 set_ssl_config_service(other->ssl_config_service()); | 50 set_ssl_config_service(other->ssl_config_service()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 74 // many we leaked so we have an idea of how bad it is. | 77 // many we leaked so we have an idea of how bad it is. |
| 75 char url_buf[128]; | 78 char url_buf[128]; |
| 76 const URLRequest* request = *url_requests_->begin(); | 79 const URLRequest* request = *url_requests_->begin(); |
| 77 base::strlcpy(url_buf, request->url().spec().c_str(), arraysize(url_buf)); | 80 base::strlcpy(url_buf, request->url().spec().c_str(), arraysize(url_buf)); |
| 78 base::debug::Alias(url_buf); | 81 base::debug::Alias(url_buf); |
| 79 base::debug::Alias(&num_requests); | 82 base::debug::Alias(&num_requests); |
| 80 CHECK(false); | 83 CHECK(false); |
| 81 } | 84 } |
| 82 } | 85 } |
| 83 | 86 |
| 84 URLRequestContext::~URLRequestContext() { | |
| 85 AssertNoURLRequests(); | |
| 86 } | |
| 87 | |
| 88 } // namespace net | 87 } // namespace net |
| OLD | NEW |