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/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "net/cookies/cookie_store.h" | 11 #include "net/cookies/cookie_store.h" |
12 #include "net/dns/host_resolver.h" | 12 #include "net/dns/host_resolver.h" |
13 #include "net/http/http_transaction_factory.h" | 13 #include "net/http/http_transaction_factory.h" |
14 #include "net/url_request/http_user_agent_settings.h" | 14 #include "net/url_request/http_user_agent_settings.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 URLRequestContext::URLRequestContext() | 19 URLRequestContext::URLRequestContext() |
20 : net_log_(NULL), | 20 : net_log_(NULL), |
21 host_resolver_(NULL), | 21 host_resolver_(NULL), |
22 cert_verifier_(NULL), | 22 cert_verifier_(NULL), |
23 server_bound_cert_service_(NULL), | 23 server_bound_cert_service_(NULL), |
24 fraudulent_certificate_reporter_(NULL), | 24 fraudulent_certificate_reporter_(NULL), |
25 http_auth_handler_factory_(NULL), | 25 http_auth_handler_factory_(NULL), |
26 proxy_service_(NULL), | 26 proxy_service_(NULL), |
27 network_delegate_(NULL), | 27 network_delegate_(NULL), |
28 http_user_agent_settings_(NULL), | 28 http_user_agent_settings_(NULL), |
29 transport_security_state_(NULL), | 29 transport_security_state_(NULL), |
| 30 cert_transparency_verifier_(NULL), |
30 http_transaction_factory_(NULL), | 31 http_transaction_factory_(NULL), |
31 job_factory_(NULL), | 32 job_factory_(NULL), |
32 throttler_manager_(NULL), | 33 throttler_manager_(NULL), |
33 url_requests_(new std::set<const URLRequest*>) { | 34 url_requests_(new std::set<const URLRequest*>) { |
34 } | 35 } |
35 | 36 |
36 URLRequestContext::~URLRequestContext() { | 37 URLRequestContext::~URLRequestContext() { |
37 AssertNoURLRequests(); | 38 AssertNoURLRequests(); |
38 } | 39 } |
39 | 40 |
40 void URLRequestContext::CopyFrom(const URLRequestContext* other) { | 41 void URLRequestContext::CopyFrom(const URLRequestContext* other) { |
41 // Copy URLRequestContext parameters. | 42 // Copy URLRequestContext parameters. |
42 set_net_log(other->net_log_); | 43 set_net_log(other->net_log_); |
43 set_host_resolver(other->host_resolver_); | 44 set_host_resolver(other->host_resolver_); |
44 set_cert_verifier(other->cert_verifier_); | 45 set_cert_verifier(other->cert_verifier_); |
45 set_server_bound_cert_service(other->server_bound_cert_service_); | 46 set_server_bound_cert_service(other->server_bound_cert_service_); |
46 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter_); | 47 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter_); |
47 set_http_auth_handler_factory(other->http_auth_handler_factory_); | 48 set_http_auth_handler_factory(other->http_auth_handler_factory_); |
48 set_proxy_service(other->proxy_service_); | 49 set_proxy_service(other->proxy_service_); |
49 set_ssl_config_service(other->ssl_config_service_.get()); | 50 set_ssl_config_service(other->ssl_config_service_.get()); |
50 set_network_delegate(other->network_delegate_); | 51 set_network_delegate(other->network_delegate_); |
51 set_http_server_properties(other->http_server_properties_); | 52 set_http_server_properties(other->http_server_properties_); |
52 set_cookie_store(other->cookie_store_.get()); | 53 set_cookie_store(other->cookie_store_.get()); |
53 set_transport_security_state(other->transport_security_state_); | 54 set_transport_security_state(other->transport_security_state_); |
| 55 set_cert_transparency_verifier(other->cert_transparency_verifier_); |
54 set_http_transaction_factory(other->http_transaction_factory_); | 56 set_http_transaction_factory(other->http_transaction_factory_); |
55 set_job_factory(other->job_factory_); | 57 set_job_factory(other->job_factory_); |
56 set_throttler_manager(other->throttler_manager_); | 58 set_throttler_manager(other->throttler_manager_); |
57 set_http_user_agent_settings(other->http_user_agent_settings_); | 59 set_http_user_agent_settings(other->http_user_agent_settings_); |
58 } | 60 } |
59 | 61 |
60 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( | 62 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( |
61 ) const { | 63 ) const { |
62 HttpTransactionFactory* transaction_factory = http_transaction_factory(); | 64 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
63 if (!transaction_factory) | 65 if (!transaction_factory) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 base::debug::Alias(&num_requests); | 108 base::debug::Alias(&num_requests); |
107 base::debug::Alias(&has_delegate); | 109 base::debug::Alias(&has_delegate); |
108 base::debug::Alias(&load_flags); | 110 base::debug::Alias(&load_flags); |
109 base::debug::Alias(&stack_trace); | 111 base::debug::Alias(&stack_trace); |
110 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 112 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
111 << request->url().spec().c_str() << "."; | 113 << request->url().spec().c_str() << "."; |
112 } | 114 } |
113 } | 115 } |
114 | 116 |
115 } // namespace net | 117 } // namespace net |
OLD | NEW |