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 // This class is useful for building a simple URLRequestContext. Most creators | 5 // This class is useful for building a simple URLRequestContext. Most creators |
6 // of new URLRequestContexts should use this helper class to construct it. Call | 6 // of new URLRequestContexts should use this helper class to construct it. Call |
7 // any configuration params, and when done, invoke Build() to construct the | 7 // any configuration params, and when done, invoke Build() to construct the |
8 // URLRequestContext. This URLRequestContext will own all its own storage. | 8 // URLRequestContext. This URLRequestContext will own all its own storage. |
9 // | 9 // |
10 // URLRequestContextBuilder and its associated params classes are initially | 10 // URLRequestContextBuilder and its associated params classes are initially |
11 // populated with "sane" default values. Read through the comments to figure out | 11 // populated with "sane" default values. Read through the comments to figure out |
12 // what these are. | 12 // what these are. |
13 | 13 |
14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
16 | 16 |
17 #include <string> | 17 #include <string> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
21 #include "base/files/file_path.h" | 21 #include "base/files/file_path.h" |
22 #include "base/memory/ref_counted.h" | 22 #include "base/memory/ref_counted.h" |
23 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
24 #include "base/memory/scoped_vector.h" | 24 #include "base/memory/scoped_vector.h" |
25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
26 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" |
27 #include "net/base/network_delegate.h" | 27 #include "net/base/network_delegate.h" |
28 #include "net/dns/host_resolver.h" | 28 #include "net/dns/host_resolver.h" |
29 #include "net/http/http_network_session.h" | |
29 #include "net/proxy/proxy_config_service.h" | 30 #include "net/proxy/proxy_config_service.h" |
30 #include "net/proxy/proxy_service.h" | 31 #include "net/proxy/proxy_service.h" |
31 #include "net/quic/quic_protocol.h" | 32 #include "net/quic/quic_protocol.h" |
32 #include "net/socket/next_proto.h" | 33 #include "net/socket/next_proto.h" |
33 | 34 |
34 namespace base { | 35 namespace base { |
35 class SingleThreadTaskRunner; | 36 class SingleThreadTaskRunner; |
36 } | 37 } |
37 | 38 |
38 namespace net { | 39 namespace net { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 std::string trusted_spdy_proxy; | 83 std::string trusted_spdy_proxy; |
83 bool use_alternate_protocols; | 84 bool use_alternate_protocols; |
84 bool enable_quic; | 85 bool enable_quic; |
85 bool enable_insecure_quic; | 86 bool enable_insecure_quic; |
86 QuicTagVector quic_connection_options; | 87 QuicTagVector quic_connection_options; |
87 }; | 88 }; |
88 | 89 |
89 URLRequestContextBuilder(); | 90 URLRequestContextBuilder(); |
90 ~URLRequestContextBuilder(); | 91 ~URLRequestContextBuilder(); |
91 | 92 |
93 static void SetHttpNetworkSessionComponents( | |
mmenke
2015/08/18 18:30:32
Should have a comment about what it does
wjmaclean
2015/08/18 18:55:37
Done.
| |
94 const URLRequestContext* context, | |
95 HttpNetworkSession::Params* params); | |
96 | |
92 // These functions are mutually exclusive. The ProxyConfigService, if | 97 // These functions are mutually exclusive. The ProxyConfigService, if |
93 // set, will be used to construct a ProxyService. | 98 // set, will be used to construct a ProxyService. |
94 void set_proxy_config_service(ProxyConfigService* proxy_config_service) { | 99 void set_proxy_config_service(ProxyConfigService* proxy_config_service) { |
95 proxy_config_service_.reset(proxy_config_service); | 100 proxy_config_service_.reset(proxy_config_service); |
96 } | 101 } |
97 void set_proxy_service(ProxyService* proxy_service) { | 102 void set_proxy_service(ProxyService* proxy_service) { |
98 proxy_service_.reset(proxy_service); | 103 proxy_service_.reset(proxy_service); |
99 } | 104 } |
100 | 105 |
101 // Call these functions to specify hard-coded Accept-Language | 106 // Call these functions to specify hard-coded Accept-Language |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 std::vector<SchemeFactory> extra_http_auth_handlers_; | 270 std::vector<SchemeFactory> extra_http_auth_handlers_; |
266 ScopedVector<URLRequestInterceptor> url_request_interceptors_; | 271 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
267 scoped_ptr<HttpServerProperties> http_server_properties_; | 272 scoped_ptr<HttpServerProperties> http_server_properties_; |
268 | 273 |
269 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 274 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
270 }; | 275 }; |
271 | 276 |
272 } // namespace net | 277 } // namespace net |
273 | 278 |
274 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 279 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
OLD | NEW |