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 30 matching lines...) Expand all Loading... |
78 bool has_delegate = request->has_delegate(); | 81 bool has_delegate = request->has_delegate(); |
79 int load_flags = request->load_flags(); | 82 int load_flags = request->load_flags(); |
80 base::debug::Alias(url_buf); | 83 base::debug::Alias(url_buf); |
81 base::debug::Alias(&num_requests); | 84 base::debug::Alias(&num_requests); |
82 base::debug::Alias(&has_delegate); | 85 base::debug::Alias(&has_delegate); |
83 base::debug::Alias(&load_flags); | 86 base::debug::Alias(&load_flags); |
84 CHECK(false); | 87 CHECK(false); |
85 } | 88 } |
86 } | 89 } |
87 | 90 |
88 URLRequestContext::~URLRequestContext() { | |
89 AssertNoURLRequests(); | |
90 } | |
91 | |
92 } // namespace net | 91 } // namespace net |
OLD | NEW |