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

Unified Diff: net/url_request/url_request_context_builder.h

Issue 2881613002: Allow use of Mojo/V8 ProxyResolvers with URLRequestContextBuilder. (Closed)
Patch Set: Merge Created 3 years, 7 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
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 2c0443789216832c01aa0262da29aa9fd820631f..d30aa873eeaa7759f782a047e243e689bc083645 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -112,7 +112,7 @@ class NET_EXPORT URLRequestContextBuilder {
};
URLRequestContextBuilder();
- ~URLRequestContextBuilder();
+ virtual ~URLRequestContextBuilder();
// Sets a name for this URLRequestContext. Currently the name is used in
// MemoryDumpProvier to annotate memory usage. The name does not need to be
@@ -143,6 +143,9 @@ class NET_EXPORT URLRequestContextBuilder {
std::unique_ptr<ProxyConfigService> proxy_config_service) {
proxy_config_service_ = std::move(proxy_config_service);
}
+
+ // Sets the proxy service. If one is not provided, uses system libraries to
eroman 2017/05/16 20:21:20 Is this comment accurate? Given that the CreatePro
mmenke 2017/05/17 02:29:58 It's accurate for the base implementation, not the
+ // evaluate PAC scripts, if available (And if not, skips PAC resolution).
void set_proxy_service(std::unique_ptr<ProxyService> proxy_service) {
proxy_service_ = std::move(proxy_service);
}
@@ -331,6 +334,17 @@ class NET_EXPORT URLRequestContextBuilder {
std::unique_ptr<URLRequestContext> Build();
+ protected:
+ // Lets subclasses override ProxyService creation, using a ProxyService that
+ // uses the URLRequestContext itself to get PAC scripts. When this method is
+ // invoked, the URLRequestContext is not yet ready to service requests.
+ virtual std::unique_ptr<ProxyService> CreateProxyService(
+ std::unique_ptr<ProxyConfigService> proxy_config_service,
+ URLRequestContext* url_request_context,
+ HostResolver* host_resolver,
+ NetworkDelegate* network_delegate,
+ NetLog* net_log);
+
private:
const char* name_;
bool enable_brotli_;

Powered by Google App Engine
This is Rietveld 408576698