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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 c2e1135974164334977ed5a9c1878b9bdd3858d9..303dd1761bfd0312645c30b2e2733390f233effe 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -209,8 +209,7 @@ URLRequestContextBuilder::URLRequestContextBuilder()
ftp_enabled_(false),
#endif
http_cache_enabled_(true),
- throttling_enabled_(false),
- channel_id_enabled_(true) {
+ throttling_enabled_(false) {
}
URLRequestContextBuilder::~URLRequestContextBuilder() {}
@@ -232,6 +231,14 @@ void URLRequestContextBuilder::SetSpdyAndQuicEnabled(bool spdy_enabled,
http_network_session_params_.enable_quic = quic_enabled;
}
+void URLRequestContextBuilder::SetCookieAndChannelIdStores(
+ const scoped_refptr<CookieStore>& cookie_store,
+ scoped_ptr<ChannelIDService> channel_id_service) {
+ DCHECK(cookie_store);
+ cookie_store_ = cookie_store;
+ channel_id_service_ = channel_id_service.Pass();
+}
+
URLRequestContext* URLRequestContextBuilder::Build() {
BasicURLRequestContext* context = new BasicURLRequestContext;
URLRequestContextStorage* storage = context->storage();
@@ -290,15 +297,17 @@ URLRequestContext* URLRequestContextBuilder::Build() {
extra_http_auth_handlers_[i].factory);
}
storage->set_http_auth_handler_factory(http_auth_handler_registry_factory);
- storage->set_cookie_store(new CookieMonster(NULL, NULL));
- if (channel_id_enabled_) {
+ if (cookie_store_) {
+ storage->set_cookie_store(cookie_store_.get());
+ storage->set_channel_id_service(channel_id_service_.Pass());
+ } else {
+ storage->set_cookie_store(new CookieMonster(NULL, NULL));
// TODO(mmenke): This always creates a file thread, even when it ends up
// not being used. Consider lazily creating the thread.
- storage->set_channel_id_service(
- new ChannelIDService(
- new DefaultChannelIDStore(NULL),
- context->GetFileThread()->message_loop_proxy()));
+ storage->set_channel_id_service(make_scoped_ptr(
+ new ChannelIDService(new DefaultChannelIDStore(NULL),
+ context->GetFileThread()->message_loop_proxy())));
}
storage->set_transport_security_state(new net::TransportSecurityState());

Powered by Google App Engine
This is Rietveld 408576698