| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 namespace net { | 46 namespace net { |
| 47 | 47 |
| 48 class CertVerifier; | 48 class CertVerifier; |
| 49 class ChannelIDService; | 49 class ChannelIDService; |
| 50 class CookieStore; | 50 class CookieStore; |
| 51 class CTVerifier; | 51 class CTVerifier; |
| 52 class HttpAuthHandlerFactory; | 52 class HttpAuthHandlerFactory; |
| 53 class HttpServerProperties; | 53 class HttpServerProperties; |
| 54 class NetworkQualityEstimator; | 54 class NetworkQualityEstimator; |
| 55 class ProxyConfigService; | 55 class ProxyConfigService; |
| 56 class SocketPerformanceWatcherFactory; | |
| 57 class URLRequestContext; | 56 class URLRequestContext; |
| 58 class URLRequestInterceptor; | 57 class URLRequestInterceptor; |
| 59 | 58 |
| 60 class NET_EXPORT URLRequestContextBuilder { | 59 class NET_EXPORT URLRequestContextBuilder { |
| 61 public: | 60 public: |
| 62 struct NET_EXPORT HttpCacheParams { | 61 struct NET_EXPORT HttpCacheParams { |
| 63 enum Type { | 62 enum Type { |
| 64 // In-memory cache. | 63 // In-memory cache. |
| 65 IN_MEMORY, | 64 IN_MEMORY, |
| 66 // Disk cache using "default" backend. | 65 // Disk cache using "default" backend. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 270 |
| 272 void set_quic_race_cert_verification(bool quic_race_cert_verification) { | 271 void set_quic_race_cert_verification(bool quic_race_cert_verification) { |
| 273 http_network_session_params_.quic_race_cert_verification = | 272 http_network_session_params_.quic_race_cert_verification = |
| 274 quic_race_cert_verification; | 273 quic_race_cert_verification; |
| 275 } | 274 } |
| 276 | 275 |
| 277 void set_throttling_enabled(bool throttling_enabled) { | 276 void set_throttling_enabled(bool throttling_enabled) { |
| 278 throttling_enabled_ = throttling_enabled; | 277 throttling_enabled_ = throttling_enabled; |
| 279 } | 278 } |
| 280 | 279 |
| 281 void set_socket_performance_watcher_factory( | |
| 282 SocketPerformanceWatcherFactory* socket_performance_watcher_factory) { | |
| 283 socket_performance_watcher_factory_ = socket_performance_watcher_factory; | |
| 284 } | |
| 285 | |
| 286 void set_ct_verifier(std::unique_ptr<CTVerifier> ct_verifier); | 280 void set_ct_verifier(std::unique_ptr<CTVerifier> ct_verifier); |
| 287 | 281 |
| 288 void SetCertVerifier(std::unique_ptr<CertVerifier> cert_verifier); | 282 void SetCertVerifier(std::unique_ptr<CertVerifier> cert_verifier); |
| 289 | 283 |
| 290 void SetInterceptors(std::vector<std::unique_ptr<URLRequestInterceptor>> | 284 void SetInterceptors(std::vector<std::unique_ptr<URLRequestInterceptor>> |
| 291 url_request_interceptors); | 285 url_request_interceptors); |
| 292 | 286 |
| 293 // Override the default in-memory cookie store and channel id service. | 287 // Override the default in-memory cookie store and channel id service. |
| 294 // If both |cookie_store| and |channel_id_service| are NULL, CookieStore and | 288 // If both |cookie_store| and |channel_id_service| are NULL, CookieStore and |
| 295 // ChannelIDService will be disabled for this context. | 289 // ChannelIDService will be disabled for this context. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 std::unique_ptr<NetworkDelegate> network_delegate_; | 363 std::unique_ptr<NetworkDelegate> network_delegate_; |
| 370 std::unique_ptr<ProxyDelegate> proxy_delegate_; | 364 std::unique_ptr<ProxyDelegate> proxy_delegate_; |
| 371 std::unique_ptr<CookieStore> cookie_store_; | 365 std::unique_ptr<CookieStore> cookie_store_; |
| 372 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_; | 366 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_; |
| 373 std::unique_ptr<CertVerifier> cert_verifier_; | 367 std::unique_ptr<CertVerifier> cert_verifier_; |
| 374 std::unique_ptr<CTVerifier> ct_verifier_; | 368 std::unique_ptr<CTVerifier> ct_verifier_; |
| 375 std::vector<std::unique_ptr<URLRequestInterceptor>> url_request_interceptors_; | 369 std::vector<std::unique_ptr<URLRequestInterceptor>> url_request_interceptors_; |
| 376 std::unique_ptr<HttpServerProperties> http_server_properties_; | 370 std::unique_ptr<HttpServerProperties> http_server_properties_; |
| 377 std::map<std::string, std::unique_ptr<URLRequestJobFactory::ProtocolHandler>> | 371 std::map<std::string, std::unique_ptr<URLRequestJobFactory::ProtocolHandler>> |
| 378 protocol_handlers_; | 372 protocol_handlers_; |
| 379 // SocketPerformanceWatcherFactory to be used by this context builder. | |
| 380 // Not owned by the context builder. Once it is set to a non-null value, it | |
| 381 // is guaranteed to be non-null during the lifetime of |this|. | |
| 382 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; | |
| 383 | 373 |
| 384 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 374 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 385 }; | 375 }; |
| 386 | 376 |
| 387 } // namespace net | 377 } // namespace net |
| 388 | 378 |
| 389 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 379 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |