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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 cert_transparency_verifier_(nullptr), | 31 cert_transparency_verifier_(nullptr), |
32 ct_policy_enforcer_(nullptr), | 32 ct_policy_enforcer_(nullptr), |
33 http_transaction_factory_(nullptr), | 33 http_transaction_factory_(nullptr), |
34 job_factory_(nullptr), | 34 job_factory_(nullptr), |
35 throttler_manager_(nullptr), | 35 throttler_manager_(nullptr), |
36 backoff_manager_(nullptr), | 36 backoff_manager_(nullptr), |
37 sdch_manager_(nullptr), | 37 sdch_manager_(nullptr), |
38 network_quality_estimator_(nullptr), | 38 network_quality_estimator_(nullptr), |
39 url_requests_(new std::set<const URLRequest*>), | 39 url_requests_(new std::set<const URLRequest*>), |
40 has_known_mismatched_cookie_store_(false), | 40 has_known_mismatched_cookie_store_(false), |
41 enable_brotli_(false) {} | 41 enable_brotli_(false), |
| 42 enable_referrer_policy_header_(false) {} |
42 | 43 |
43 URLRequestContext::~URLRequestContext() { | 44 URLRequestContext::~URLRequestContext() { |
44 AssertNoURLRequests(); | 45 AssertNoURLRequests(); |
45 } | 46 } |
46 | 47 |
47 void URLRequestContext::CopyFrom(const URLRequestContext* other) { | 48 void URLRequestContext::CopyFrom(const URLRequestContext* other) { |
48 // Copy URLRequestContext parameters. | 49 // Copy URLRequestContext parameters. |
49 set_net_log(other->net_log_); | 50 set_net_log(other->net_log_); |
50 set_host_resolver(other->host_resolver_); | 51 set_host_resolver(other->host_resolver_); |
51 set_cert_verifier(other->cert_verifier_); | 52 set_cert_verifier(other->cert_verifier_); |
52 set_channel_id_service(other->channel_id_service_); | 53 set_channel_id_service(other->channel_id_service_); |
53 set_http_auth_handler_factory(other->http_auth_handler_factory_); | 54 set_http_auth_handler_factory(other->http_auth_handler_factory_); |
54 set_proxy_service(other->proxy_service_); | 55 set_proxy_service(other->proxy_service_); |
55 set_ssl_config_service(other->ssl_config_service_.get()); | 56 set_ssl_config_service(other->ssl_config_service_.get()); |
56 set_network_delegate(other->network_delegate_); | 57 set_network_delegate(other->network_delegate_); |
57 set_http_server_properties(other->http_server_properties_); | 58 set_http_server_properties(other->http_server_properties_); |
58 set_cookie_store(other->cookie_store_); | 59 set_cookie_store(other->cookie_store_); |
59 set_transport_security_state(other->transport_security_state_); | 60 set_transport_security_state(other->transport_security_state_); |
60 set_cert_transparency_verifier(other->cert_transparency_verifier_); | 61 set_cert_transparency_verifier(other->cert_transparency_verifier_); |
61 set_ct_policy_enforcer(other->ct_policy_enforcer_); | 62 set_ct_policy_enforcer(other->ct_policy_enforcer_); |
62 set_http_transaction_factory(other->http_transaction_factory_); | 63 set_http_transaction_factory(other->http_transaction_factory_); |
63 set_job_factory(other->job_factory_); | 64 set_job_factory(other->job_factory_); |
64 set_throttler_manager(other->throttler_manager_); | 65 set_throttler_manager(other->throttler_manager_); |
65 set_backoff_manager(other->backoff_manager_); | 66 set_backoff_manager(other->backoff_manager_); |
66 set_sdch_manager(other->sdch_manager_); | 67 set_sdch_manager(other->sdch_manager_); |
67 set_http_user_agent_settings(other->http_user_agent_settings_); | 68 set_http_user_agent_settings(other->http_user_agent_settings_); |
68 set_network_quality_estimator(other->network_quality_estimator_); | 69 set_network_quality_estimator(other->network_quality_estimator_); |
69 set_enable_brotli(other->enable_brotli_); | 70 set_enable_brotli(other->enable_brotli_); |
| 71 set_enable_referrer_policy_header(other->enable_referrer_policy_header_); |
70 } | 72 } |
71 | 73 |
72 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( | 74 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( |
73 ) const { | 75 ) const { |
74 HttpTransactionFactory* transaction_factory = http_transaction_factory(); | 76 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
75 if (!transaction_factory) | 77 if (!transaction_factory) |
76 return nullptr; | 78 return nullptr; |
77 HttpNetworkSession* network_session = transaction_factory->GetSession(); | 79 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
78 if (!network_session) | 80 if (!network_session) |
79 return nullptr; | 81 return nullptr; |
(...skipping 23 matching lines...) Expand all Loading... |
103 int load_flags = request->load_flags(); | 105 int load_flags = request->load_flags(); |
104 base::debug::Alias(url_buf); | 106 base::debug::Alias(url_buf); |
105 base::debug::Alias(&num_requests); | 107 base::debug::Alias(&num_requests); |
106 base::debug::Alias(&load_flags); | 108 base::debug::Alias(&load_flags); |
107 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 109 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
108 << request->url().spec().c_str() << "."; | 110 << request->url().spec().c_str() << "."; |
109 } | 111 } |
110 } | 112 } |
111 | 113 |
112 } // namespace net | 114 } // namespace net |
OLD | NEW |