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 #include "net/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 http_auth_handler_factory_ = | 334 http_auth_handler_factory_ = |
335 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver()); | 335 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver()); |
336 } | 336 } |
337 | 337 |
338 storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_)); | 338 storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_)); |
339 | 339 |
340 if (cookie_store_) { | 340 if (cookie_store_) { |
341 storage->set_cookie_store(std::move(cookie_store_)); | 341 storage->set_cookie_store(std::move(cookie_store_)); |
342 storage->set_channel_id_service(std::move(channel_id_service_)); | 342 storage->set_channel_id_service(std::move(channel_id_service_)); |
343 } else { | 343 } else { |
344 storage->set_cookie_store( | 344 scoped_ptr<CookieStore> cookie_store(new CookieMonster(nullptr, nullptr)); |
345 make_scoped_ptr(new CookieMonster(nullptr, nullptr))); | |
346 // TODO(mmenke): This always creates a file thread, even when it ends up | 345 // TODO(mmenke): This always creates a file thread, even when it ends up |
347 // not being used. Consider lazily creating the thread. | 346 // not being used. Consider lazily creating the thread. |
348 storage->set_channel_id_service(make_scoped_ptr(new ChannelIDService( | 347 scoped_ptr<ChannelIDService> channel_id_service(new ChannelIDService( |
349 new DefaultChannelIDStore(NULL), context->GetFileTaskRunner()))); | 348 new DefaultChannelIDStore(NULL), context->GetFileTaskRunner())); |
349 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); | |
350 storage->set_cookie_store(std::move(cookie_store)); | |
351 storage->set_channel_id_service(std::move(channel_id_service)); | |
mmenke
2016/03/18 22:12:56
Suggestion: Replace URLRequestContext::set_cookie
nharper
2016/03/18 22:31:09
The problem with this is that resetting the cookie
mmenke
2016/03/18 22:36:02
This is true...But this code has the exact same pr
nharper
2016/03/18 23:09:01
Ok, I think I'm understanding how this could work.
mmenke
2016/03/22 15:46:04
We could, if we required the HttpNetworkSession be
| |
350 } | 352 } |
351 | 353 |
352 if (sdch_enabled_) { | 354 if (sdch_enabled_) { |
353 storage->set_sdch_manager(scoped_ptr<net::SdchManager>(new SdchManager())); | 355 storage->set_sdch_manager(scoped_ptr<net::SdchManager>(new SdchManager())); |
354 } | 356 } |
355 | 357 |
356 storage->set_transport_security_state( | 358 storage->set_transport_security_state( |
357 make_scoped_ptr(new TransportSecurityState())); | 359 make_scoped_ptr(new TransportSecurityState())); |
358 if (!transport_security_persister_path_.empty()) { | 360 if (!transport_security_persister_path_.empty()) { |
359 context->set_transport_security_persister( | 361 context->set_transport_security_persister( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 } | 508 } |
507 url_request_interceptors_.clear(); | 509 url_request_interceptors_.clear(); |
508 } | 510 } |
509 storage->set_job_factory(std::move(top_job_factory)); | 511 storage->set_job_factory(std::move(top_job_factory)); |
510 // TODO(willchan): Support sdch. | 512 // TODO(willchan): Support sdch. |
511 | 513 |
512 return std::move(context); | 514 return std::move(context); |
513 } | 515 } |
514 | 516 |
515 } // namespace net | 517 } // namespace net |
OLD | NEW |