| 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 "build/build_config.h" | 25 #include "build/build_config.h" |
| 25 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" |
| 26 #include "net/base/network_delegate.h" | 27 #include "net/base/network_delegate.h" |
| 27 #include "net/dns/host_resolver.h" | 28 #include "net/dns/host_resolver.h" |
| 28 #include "net/http/http_network_session.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 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 throttling_enabled_ = throttling_enabled; | 221 throttling_enabled_ = throttling_enabled; |
| 221 } | 222 } |
| 222 | 223 |
| 223 void set_backoff_enabled(bool backoff_enabled) { | 224 void set_backoff_enabled(bool backoff_enabled) { |
| 224 backoff_enabled_ = backoff_enabled; | 225 backoff_enabled_ = backoff_enabled; |
| 225 } | 226 } |
| 226 | 227 |
| 227 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); | 228 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); |
| 228 | 229 |
| 229 void SetInterceptors( | 230 void SetInterceptors( |
| 230 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors); | 231 ScopedVector<URLRequestInterceptor> url_request_interceptors); |
| 231 | 232 |
| 232 // Override the default in-memory cookie store and channel id service. | 233 // Override the default in-memory cookie store and channel id service. |
| 233 // |cookie_store| must not be NULL. |channel_id_service| may be NULL to | 234 // |cookie_store| must not be NULL. |channel_id_service| may be NULL to |
| 234 // disable channel id for this context. | 235 // disable channel id for this context. |
| 235 // Note that a persistent cookie store should not be used with an in-memory | 236 // Note that a persistent cookie store should not be used with an in-memory |
| 236 // channel id service, and one cookie store should not be shared between | 237 // channel id service, and one cookie store should not be shared between |
| 237 // multiple channel-id stores (or used both with and without a channel id | 238 // multiple channel-id stores (or used both with and without a channel id |
| 238 // store). | 239 // store). |
| 239 void SetCookieAndChannelIdStores( | 240 void SetCookieAndChannelIdStores( |
| 240 const scoped_refptr<CookieStore>& cookie_store, | 241 const scoped_refptr<CookieStore>& cookie_store, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 NetLog* net_log_; | 293 NetLog* net_log_; |
| 293 scoped_ptr<HostResolver> host_resolver_; | 294 scoped_ptr<HostResolver> host_resolver_; |
| 294 scoped_ptr<ChannelIDService> channel_id_service_; | 295 scoped_ptr<ChannelIDService> channel_id_service_; |
| 295 scoped_ptr<ProxyConfigService> proxy_config_service_; | 296 scoped_ptr<ProxyConfigService> proxy_config_service_; |
| 296 scoped_ptr<ProxyService> proxy_service_; | 297 scoped_ptr<ProxyService> proxy_service_; |
| 297 scoped_ptr<NetworkDelegate> network_delegate_; | 298 scoped_ptr<NetworkDelegate> network_delegate_; |
| 298 scoped_refptr<CookieStore> cookie_store_; | 299 scoped_refptr<CookieStore> cookie_store_; |
| 299 scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_; | 300 scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_; |
| 300 std::vector<SchemeFactory> extra_http_auth_handlers_; | 301 std::vector<SchemeFactory> extra_http_auth_handlers_; |
| 301 scoped_ptr<CertVerifier> cert_verifier_; | 302 scoped_ptr<CertVerifier> cert_verifier_; |
| 302 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors_; | 303 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
| 303 scoped_ptr<HttpServerProperties> http_server_properties_; | 304 scoped_ptr<HttpServerProperties> http_server_properties_; |
| 304 | 305 |
| 305 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 306 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 306 }; | 307 }; |
| 307 | 308 |
| 308 } // namespace net | 309 } // namespace net |
| 309 | 310 |
| 310 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 311 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |