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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 1175733002: [Cronet] Set up HttpServerPropertiesManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make builder depend on HttpServerProperties, and pass in weak ptr Created 5 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
Index: net/url_request/url_request_context_builder.cc
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index 771bc3f25f28e91c929b3e60c4baae85ce8ca54b..f1a0a93dd9b05e1aa9ef6e6b8df3fba6fa2fca1f 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -26,6 +26,7 @@
#include "net/http/http_network_layer.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_impl.h"
+#include "net/http/http_server_properties_manager.h"
#include "net/http/transport_security_persister.h"
#include "net/http/transport_security_state.h"
#include "net/ssl/channel_id_service.h"
@@ -243,6 +244,11 @@ void URLRequestContextBuilder::SetFileTaskRunner(
file_task_runner_ = task_runner;
}
+void URLRequestContextBuilder::SetHttpServerProperties(
+ base::WeakPtr<HttpServerProperties> http_server_properties) {
+ http_server_properties_ = http_server_properties;
+}
+
URLRequestContext* URLRequestContextBuilder::Build() {
BasicURLRequestContext* context =
new BasicURLRequestContext(file_task_runner_);
@@ -326,8 +332,13 @@ URLRequestContext* URLRequestContextBuilder::Build() {
false)));
}
- storage->set_http_server_properties(
- scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
+ if (http_server_properties_) {
+ context->set_http_server_properties(http_server_properties_);
+ } else {
+ storage->set_http_server_properties(
+ scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
+ }
+
storage->set_cert_verifier(CertVerifier::CreateDefault());
if (throttling_enabled_)

Powered by Google App Engine
This is Rietveld 408576698