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 11 matching lines...) Expand all Loading... | |
| 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 "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "net/base/net_export.h" | 25 #include "net/base/net_export.h" |
| 26 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" |
| 27 #include "net/dns/host_resolver.h" | 27 #include "net/dns/host_resolver.h" |
| 28 #include "net/proxy/proxy_config_service.h" | 28 #include "net/proxy/proxy_config_service.h" |
| 29 #include "net/proxy/proxy_service.h" | 29 #include "net/proxy/proxy_service.h" |
| 30 #include "net/quic/quic_protocol.h" | 30 #include "net/quic/quic_protocol.h" |
| 31 #include "net/socket/next_proto.h" | 31 #include "net/socket/next_proto.h" |
| 32 #include "net/url_request/url_request_interceptor.h" | |
|
mmenke
2015/03/10 15:26:55
Suggest forward declaring this. May have to de-in
bengr
2015/03/10 23:43:31
Done.
| |
| 32 | 33 |
| 33 namespace net { | 34 namespace net { |
| 34 | 35 |
| 35 class ChannelIDService; | 36 class ChannelIDService; |
| 36 class CookieStore; | 37 class CookieStore; |
| 37 class FtpTransactionFactory; | 38 class FtpTransactionFactory; |
| 38 class HostMappingRules; | 39 class HostMappingRules; |
| 39 class HttpAuthHandlerFactory; | 40 class HttpAuthHandlerFactory; |
| 40 class ProxyConfigService; | 41 class ProxyConfigService; |
| 41 class URLRequestContext; | 42 class URLRequestContext; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 void set_quic_connection_options( | 170 void set_quic_connection_options( |
| 170 const QuicTagVector& quic_connection_options) { | 171 const QuicTagVector& quic_connection_options) { |
| 171 http_network_session_params_.quic_connection_options = | 172 http_network_session_params_.quic_connection_options = |
| 172 quic_connection_options; | 173 quic_connection_options; |
| 173 } | 174 } |
| 174 | 175 |
| 175 void set_throttling_enabled(bool throttling_enabled) { | 176 void set_throttling_enabled(bool throttling_enabled) { |
| 176 throttling_enabled_ = throttling_enabled; | 177 throttling_enabled_ = throttling_enabled; |
| 177 } | 178 } |
| 178 | 179 |
| 180 void set_interceptor(scoped_ptr<URLRequestInterceptor> interceptor) { | |
| 181 url_request_interceptor_ = interceptor.Pass(); | |
|
mmenke
2015/03/10 15:26:55
We should probably allow an ordered list of interc
bengr
2015/03/10 23:43:31
Done.
| |
| 182 } | |
| 183 | |
| 179 // Override the default in-memory cookie store and channel id service. | 184 // Override the default in-memory cookie store and channel id service. |
| 180 // |cookie_store| must not be NULL. |channel_id_service| may be NULL to | 185 // |cookie_store| must not be NULL. |channel_id_service| may be NULL to |
| 181 // disable channel id for this context. | 186 // disable channel id for this context. |
| 182 // Note that a persistent cookie store should not be used with an in-memory | 187 // Note that a persistent cookie store should not be used with an in-memory |
| 183 // channel id service, and one cookie store should not be shared between | 188 // channel id service, and one cookie store should not be shared between |
| 184 // multiple channel-id stores (or used both with and without a channel id | 189 // multiple channel-id stores (or used both with and without a channel id |
| 185 // store). | 190 // store). |
| 186 void SetCookieAndChannelIdStores( | 191 void SetCookieAndChannelIdStores( |
| 187 const scoped_refptr<CookieStore>& cookie_store, | 192 const scoped_refptr<CookieStore>& cookie_store, |
| 188 scoped_ptr<ChannelIDService> channel_id_service); | 193 scoped_ptr<ChannelIDService> channel_id_service); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 219 base::FilePath transport_security_persister_path_; | 224 base::FilePath transport_security_persister_path_; |
| 220 scoped_ptr<NetLog> net_log_; | 225 scoped_ptr<NetLog> net_log_; |
| 221 scoped_ptr<HostResolver> host_resolver_; | 226 scoped_ptr<HostResolver> host_resolver_; |
| 222 scoped_ptr<ChannelIDService> channel_id_service_; | 227 scoped_ptr<ChannelIDService> channel_id_service_; |
| 223 scoped_ptr<ProxyConfigService> proxy_config_service_; | 228 scoped_ptr<ProxyConfigService> proxy_config_service_; |
| 224 scoped_ptr<ProxyService> proxy_service_; | 229 scoped_ptr<ProxyService> proxy_service_; |
| 225 scoped_ptr<NetworkDelegate> network_delegate_; | 230 scoped_ptr<NetworkDelegate> network_delegate_; |
| 226 scoped_refptr<CookieStore> cookie_store_; | 231 scoped_refptr<CookieStore> cookie_store_; |
| 227 scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_; | 232 scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_; |
| 228 std::vector<SchemeFactory> extra_http_auth_handlers_; | 233 std::vector<SchemeFactory> extra_http_auth_handlers_; |
| 234 scoped_ptr<URLRequestInterceptor> url_request_interceptor_; | |
| 229 | 235 |
| 230 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 236 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 231 }; | 237 }; |
| 232 | 238 |
| 233 } // namespace net | 239 } // namespace net |
| 234 | 240 |
| 235 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 241 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |