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" |
(...skipping 13 matching lines...) Expand all Loading... |
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 cert_transparency_verifier_(NULL), |
31 http_transaction_factory_(NULL), | 31 http_transaction_factory_(NULL), |
32 job_factory_(NULL), | 32 job_factory_(NULL), |
33 throttler_manager_(NULL), | 33 throttler_manager_(NULL), |
34 sdch_manager_(NULL), | 34 // For investigation of http://crbug.com/454198; restore when resolved. |
| 35 // sdch_manager_(NULL), |
| 36 have_sdch_manager_(false), |
35 url_requests_(new std::set<const URLRequest*>) { | 37 url_requests_(new std::set<const URLRequest*>) { |
36 } | 38 } |
37 | 39 |
38 URLRequestContext::~URLRequestContext() { | 40 URLRequestContext::~URLRequestContext() { |
39 AssertNoURLRequests(); | 41 AssertNoURLRequests(); |
40 } | 42 } |
41 | 43 |
42 void URLRequestContext::CopyFrom(const URLRequestContext* other) { | 44 void URLRequestContext::CopyFrom(const URLRequestContext* other) { |
43 // Copy URLRequestContext parameters. | 45 // Copy URLRequestContext parameters. |
44 set_net_log(other->net_log_); | 46 set_net_log(other->net_log_); |
45 set_host_resolver(other->host_resolver_); | 47 set_host_resolver(other->host_resolver_); |
46 set_cert_verifier(other->cert_verifier_); | 48 set_cert_verifier(other->cert_verifier_); |
47 set_channel_id_service(other->channel_id_service_); | 49 set_channel_id_service(other->channel_id_service_); |
48 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter_); | 50 set_fraudulent_certificate_reporter(other->fraudulent_certificate_reporter_); |
49 set_http_auth_handler_factory(other->http_auth_handler_factory_); | 51 set_http_auth_handler_factory(other->http_auth_handler_factory_); |
50 set_proxy_service(other->proxy_service_); | 52 set_proxy_service(other->proxy_service_); |
51 set_ssl_config_service(other->ssl_config_service_.get()); | 53 set_ssl_config_service(other->ssl_config_service_.get()); |
52 set_network_delegate(other->network_delegate_); | 54 set_network_delegate(other->network_delegate_); |
53 set_http_server_properties(other->http_server_properties_); | 55 set_http_server_properties(other->http_server_properties_); |
54 set_cookie_store(other->cookie_store_.get()); | 56 set_cookie_store(other->cookie_store_.get()); |
55 set_transport_security_state(other->transport_security_state_); | 57 set_transport_security_state(other->transport_security_state_); |
56 set_cert_transparency_verifier(other->cert_transparency_verifier_); | 58 set_cert_transparency_verifier(other->cert_transparency_verifier_); |
57 set_http_transaction_factory(other->http_transaction_factory_); | 59 set_http_transaction_factory(other->http_transaction_factory_); |
58 set_job_factory(other->job_factory_); | 60 set_job_factory(other->job_factory_); |
59 set_throttler_manager(other->throttler_manager_); | 61 set_throttler_manager(other->throttler_manager_); |
60 set_sdch_manager(other->sdch_manager_); | 62 // For investigation of http://crbug.com/454198; remove when resolved. |
| 63 CHECK(!other->have_sdch_manager_ || other->sdch_manager_.get()); |
| 64 set_sdch_manager(other->sdch_manager_.get()); |
61 set_http_user_agent_settings(other->http_user_agent_settings_); | 65 set_http_user_agent_settings(other->http_user_agent_settings_); |
62 } | 66 } |
63 | 67 |
64 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( | 68 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( |
65 ) const { | 69 ) const { |
66 HttpTransactionFactory* transaction_factory = http_transaction_factory(); | 70 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
67 if (!transaction_factory) | 71 if (!transaction_factory) |
68 return NULL; | 72 return NULL; |
69 HttpNetworkSession* network_session = transaction_factory->GetSession(); | 73 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
70 if (!network_session) | 74 if (!network_session) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::debug::Alias(&num_requests); | 107 base::debug::Alias(&num_requests); |
104 base::debug::Alias(&has_delegate); | 108 base::debug::Alias(&has_delegate); |
105 base::debug::Alias(&load_flags); | 109 base::debug::Alias(&load_flags); |
106 base::debug::Alias(&stack_trace); | 110 base::debug::Alias(&stack_trace); |
107 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 111 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
108 << request->url().spec().c_str() << "."; | 112 << request->url().spec().c_str() << "."; |
109 } | 113 } |
110 } | 114 } |
111 | 115 |
112 } // namespace net | 116 } // namespace net |
OLD | NEW |