Chromium Code Reviews| 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 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 const URLRequestContext* request_context, | 109 const URLRequestContext* request_context, |
| 110 HttpNetworkSession::Context* session_context); | 110 HttpNetworkSession::Context* session_context); |
| 111 | 111 |
| 112 // These functions are mutually exclusive. The ProxyConfigService, if | 112 // These functions are mutually exclusive. The ProxyConfigService, if |
| 113 // set, will be used to construct a ProxyService. | 113 // set, will be used to construct a ProxyService. |
| 114 void set_proxy_config_service( | 114 void set_proxy_config_service( |
| 115 std::unique_ptr<ProxyConfigService> proxy_config_service) { | 115 std::unique_ptr<ProxyConfigService> proxy_config_service) { |
| 116 proxy_config_service_ = std::move(proxy_config_service); | 116 proxy_config_service_ = std::move(proxy_config_service); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Sets whether quick PAC checks are enabled. Defaults to true. Ignored if | |
| 120 // a ProxyService is set directly. | |
| 121 void set_pac_quick_check_enabled(bool pac_quick_check_enabled) { | |
| 122 pac_quick_check_enabled_ = pac_quick_check_enabled; | |
| 123 } | |
| 124 | |
| 125 // Sets policy for sanitizing URLs before passing them a PAC. Defaults to | |
|
eroman
2017/06/08 00:45:56
them a PAC --> them to a PAC
mmenke
2017/06/08 16:36:28
Done.
| |
| 126 // ProxyService::SanitizeUrlPolicy::SAFE. Ignored if | |
| 127 // a ProxyService is set directly. | |
| 128 void set_pac_sanitize_url_policy( | |
| 129 net::ProxyService::SanitizeUrlPolicy pac_sanitize_url_policy) { | |
| 130 pac_sanitize_url_policy_ = pac_sanitize_url_policy; | |
| 131 } | |
| 132 | |
| 119 // Sets the proxy service. If one is not provided, by default, uses system | 133 // Sets the proxy service. If one is not provided, by default, uses system |
| 120 // libraries to evaluate PAC scripts, if available (And if not, skips PAC | 134 // libraries to evaluate PAC scripts, if available (And if not, skips PAC |
| 121 // resolution). Subclasses may override CreateProxyService for different | 135 // resolution). Subclasses may override CreateProxyService for different |
| 122 // default behavior. | 136 // default behavior. |
| 123 void set_proxy_service(std::unique_ptr<ProxyService> proxy_service) { | 137 void set_proxy_service(std::unique_ptr<ProxyService> proxy_service) { |
| 124 proxy_service_ = std::move(proxy_service); | 138 proxy_service_ = std::move(proxy_service); |
| 125 } | 139 } |
| 126 | 140 |
| 141 // Sets the SSL config service. Unlike most other methods, this does not take | |
| 142 // ownership of the SSLConfigService. If one is not set, will use a default | |
| 143 // SSLConfig. | |
| 144 void set_ssl_config_service_unowned(SSLConfigService* ssl_config_service) { | |
| 145 ssl_config_service_ = ssl_config_service; | |
| 146 } | |
| 147 | |
| 127 // Call these functions to specify hard-coded Accept-Language | 148 // Call these functions to specify hard-coded Accept-Language |
| 128 // or User-Agent header values for all requests that don't | 149 // or User-Agent header values for all requests that don't |
| 129 // have the headers already set. | 150 // have the headers already set. |
| 130 void set_accept_language(const std::string& accept_language) { | 151 void set_accept_language(const std::string& accept_language) { |
| 131 accept_language_ = accept_language; | 152 accept_language_ = accept_language; |
| 132 } | 153 } |
| 133 void set_user_agent(const std::string& user_agent) { | 154 void set_user_agent(const std::string& user_agent) { |
| 134 user_agent_ = user_agent; | 155 user_agent_ = user_agent; |
| 135 } | 156 } |
| 136 | 157 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 bool cookie_store_set_by_client_; | 363 bool cookie_store_set_by_client_; |
| 343 | 364 |
| 344 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | 365 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
| 345 HttpCacheParams http_cache_params_; | 366 HttpCacheParams http_cache_params_; |
| 346 HttpNetworkSession::Params http_network_session_params_; | 367 HttpNetworkSession::Params http_network_session_params_; |
| 347 base::FilePath transport_security_persister_path_; | 368 base::FilePath transport_security_persister_path_; |
| 348 NetLog* net_log_; | 369 NetLog* net_log_; |
| 349 std::unique_ptr<HostResolver> host_resolver_; | 370 std::unique_ptr<HostResolver> host_resolver_; |
| 350 std::unique_ptr<ChannelIDService> channel_id_service_; | 371 std::unique_ptr<ChannelIDService> channel_id_service_; |
| 351 std::unique_ptr<ProxyConfigService> proxy_config_service_; | 372 std::unique_ptr<ProxyConfigService> proxy_config_service_; |
| 373 bool pac_quick_check_enabled_; | |
| 374 ProxyService::SanitizeUrlPolicy pac_sanitize_url_policy_; | |
| 352 std::unique_ptr<ProxyService> proxy_service_; | 375 std::unique_ptr<ProxyService> proxy_service_; |
| 376 SSLConfigService* ssl_config_service_; | |
| 353 std::unique_ptr<NetworkDelegate> network_delegate_; | 377 std::unique_ptr<NetworkDelegate> network_delegate_; |
| 354 std::unique_ptr<ProxyDelegate> proxy_delegate_; | 378 std::unique_ptr<ProxyDelegate> proxy_delegate_; |
| 355 std::unique_ptr<CookieStore> cookie_store_; | 379 std::unique_ptr<CookieStore> cookie_store_; |
| 356 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_; | 380 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_; |
| 357 std::unique_ptr<CertVerifier> cert_verifier_; | 381 std::unique_ptr<CertVerifier> cert_verifier_; |
| 358 std::unique_ptr<CTVerifier> ct_verifier_; | 382 std::unique_ptr<CTVerifier> ct_verifier_; |
| 359 std::vector<std::unique_ptr<URLRequestInterceptor>> url_request_interceptors_; | 383 std::vector<std::unique_ptr<URLRequestInterceptor>> url_request_interceptors_; |
| 360 std::unique_ptr<HttpServerProperties> http_server_properties_; | 384 std::unique_ptr<HttpServerProperties> http_server_properties_; |
| 361 std::map<std::string, std::unique_ptr<URLRequestJobFactory::ProtocolHandler>> | 385 std::map<std::string, std::unique_ptr<URLRequestJobFactory::ProtocolHandler>> |
| 362 protocol_handlers_; | 386 protocol_handlers_; |
| 363 // SocketPerformanceWatcherFactory to be used by this context builder. | 387 // SocketPerformanceWatcherFactory to be used by this context builder. |
| 364 // Not owned by the context builder. Once it is set to a non-null value, it | 388 // Not owned by the context builder. Once it is set to a non-null value, it |
| 365 // is guaranteed to be non-null during the lifetime of |this|. | 389 // is guaranteed to be non-null during the lifetime of |this|. |
| 366 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; | 390 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; |
| 367 | 391 |
| 368 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 392 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 369 }; | 393 }; |
| 370 | 394 |
| 371 } // namespace net | 395 } // namespace net |
| 372 | 396 |
| 373 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 397 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |