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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: Small fix Created 4 years, 10 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 bc12e0911017580de636ed454ae5a1760ca72038..cde1737104cc3b8c78d5a99fdab551c49a864341 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -257,10 +257,10 @@ void URLRequestContextBuilder::SetInterceptors(
}
void URLRequestContextBuilder::SetCookieAndChannelIdStores(
- const scoped_refptr<CookieStore>& cookie_store,
- scoped_ptr<ChannelIDService> channel_id_service) {
+ scoped_ptr<CookieStore> cookie_store,
+ scoped_ptr<ChannelIDService> channel_id_service) {
DCHECK(cookie_store);
- cookie_store_ = cookie_store;
+ cookie_store_ = std::move(cookie_store);
channel_id_service_ = std::move(channel_id_service);
}
@@ -331,10 +331,11 @@ scoped_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_));
if (cookie_store_) {
- storage->set_cookie_store(cookie_store_.get());
+ storage->set_cookie_store(std::move(cookie_store_));
storage->set_channel_id_service(std::move(channel_id_service_));
} else {
- storage->set_cookie_store(new CookieMonster(NULL, NULL));
+ storage->set_cookie_store(
+ make_scoped_ptr(new CookieMonster(nullptr, nullptr)));
// 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(make_scoped_ptr(new ChannelIDService(

Powered by Google App Engine
This is Rietveld 408576698