Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: net/url_request/url_request_context_builder.h

Issue 354693004: Switch to using URLRequestContextBuilder to create some URLRequestContexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/url_loader_impl.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder.h
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h
index cf7bba2c6888cb524a704f606c2f1cc903fae122..4b09534775cb4bf058846c9a6cf701828b55f409 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -25,6 +25,8 @@
#include "net/base/net_export.h"
#include "net/base/network_delegate.h"
#include "net/dns/host_resolver.h"
+#include "net/proxy/proxy_config_service.h"
+#include "net/proxy/proxy_service.h"
#include "net/socket/next_proto.h"
namespace net {
@@ -74,7 +76,14 @@ class NET_EXPORT URLRequestContextBuilder {
URLRequestContextBuilder();
~URLRequestContextBuilder();
- void set_proxy_config_service(ProxyConfigService* proxy_config_service);
+ // These functions are mutually exclusive. The ProxyConfigService, if
+ // set, will be used to construct a ProxyService.
+ void set_proxy_config_service(ProxyConfigService* proxy_config_service) {
+ proxy_config_service_.reset(proxy_config_service);
+ }
+ void set_proxy_service(ProxyService* proxy_service) {
+ proxy_service_.reset(proxy_service);
+ }
// Call these functions to specify hard-coded Accept-Language
// or User-Agent header values for all requests that don't
@@ -105,6 +114,12 @@ class NET_EXPORT URLRequestContextBuilder {
}
#endif
+ // TODO(mmenke): Probably makes sense to get rid of this, and have consumers
+ // set their own NetLog::Observers instead.
+ void set_net_log(NetLog* net_log) {
+ net_log_.reset(net_log);
+ }
+
// By default host_resolver is constructed with CreateDefaultResolver.
void set_host_resolver(HostResolver* host_resolver) {
host_resolver_.reset(host_resolver);
@@ -128,15 +143,8 @@ class NET_EXPORT URLRequestContextBuilder {
}
// By default HttpCache is enabled with a default constructed HttpCacheParams.
- void EnableHttpCache(const HttpCacheParams& params) {
- http_cache_enabled_ = true;
- http_cache_params_ = params;
- }
-
- void DisableHttpCache() {
- http_cache_enabled_ = false;
- http_cache_params_ = HttpCacheParams();
- }
+ void EnableHttpCache(const HttpCacheParams& params);
+ void DisableHttpCache();
// Override default net::HttpNetworkSession::Params settings.
void set_http_network_session_params(
@@ -144,10 +152,19 @@ class NET_EXPORT URLRequestContextBuilder {
http_network_session_params_ = http_network_session_params;
}
+ void set_transport_security_persister_path(
+ const base::FilePath& transport_security_persister_path) {
+ transport_security_persister_path_ = transport_security_persister_path;
+ }
+
// Adjust |http_network_session_params_.next_protos| to enable SPDY and QUIC.
void SetSpdyAndQuicEnabled(bool spdy_enabled,
bool quic_enabled);
+ void set_throttling_enabled(bool throttling_enabled) {
+ throttling_enabled_ = throttling_enabled;
+ }
+
URLRequestContext* Build();
private:
@@ -173,10 +190,15 @@ class NET_EXPORT URLRequestContextBuilder {
bool ftp_enabled_;
#endif
bool http_cache_enabled_;
+ bool throttling_enabled_;
+
HttpCacheParams http_cache_params_;
HttpNetworkSessionParams http_network_session_params_;
+ base::FilePath transport_security_persister_path_;
+ scoped_ptr<NetLog> net_log_;
scoped_ptr<HostResolver> host_resolver_;
scoped_ptr<ProxyConfigService> proxy_config_service_;
+ scoped_ptr<ProxyService> proxy_service_;
scoped_ptr<NetworkDelegate> network_delegate_;
scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_;
std::vector<SchemeFactory> extra_http_auth_handlers_;
« no previous file with comments | « mojo/services/network/url_loader_impl.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698