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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 scoped_ptr<CertVerifier> cert_verifier) { 250 scoped_ptr<CertVerifier> cert_verifier) {
251 cert_verifier_ = std::move(cert_verifier); 251 cert_verifier_ = std::move(cert_verifier);
252 } 252 }
253 253
254 void URLRequestContextBuilder::SetInterceptors( 254 void URLRequestContextBuilder::SetInterceptors(
255 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors) { 255 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors) {
256 url_request_interceptors_ = std::move(url_request_interceptors); 256 url_request_interceptors_ = std::move(url_request_interceptors);
257 } 257 }
258 258
259 void URLRequestContextBuilder::SetCookieAndChannelIdStores( 259 void URLRequestContextBuilder::SetCookieAndChannelIdStores(
260 const scoped_refptr<CookieStore>& cookie_store, 260 scoped_ptr<CookieStore> cookie_store,
261 scoped_ptr<ChannelIDService> channel_id_service) { 261 scoped_ptr<ChannelIDService> channel_id_service) {
262 DCHECK(cookie_store); 262 DCHECK(cookie_store);
263 cookie_store_ = cookie_store; 263 cookie_store_ = std::move(cookie_store);
264 channel_id_service_ = std::move(channel_id_service); 264 channel_id_service_ = std::move(channel_id_service);
265 } 265 }
266 266
267 void URLRequestContextBuilder::SetFileTaskRunner( 267 void URLRequestContextBuilder::SetFileTaskRunner(
268 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 268 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
269 file_task_runner_ = task_runner; 269 file_task_runner_ = task_runner;
270 } 270 }
271 271
272 void URLRequestContextBuilder::SetHttpAuthHandlerFactory( 272 void URLRequestContextBuilder::SetHttpAuthHandlerFactory(
273 scoped_ptr<HttpAuthHandlerFactory> factory) { 273 scoped_ptr<HttpAuthHandlerFactory> factory) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 storage->set_ssl_config_service(new SSLConfigServiceDefaults); 324 storage->set_ssl_config_service(new SSLConfigServiceDefaults);
325 325
326 if (!http_auth_handler_factory_) { 326 if (!http_auth_handler_factory_) {
327 http_auth_handler_factory_ = 327 http_auth_handler_factory_ =
328 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver()); 328 HttpAuthHandlerRegistryFactory::CreateDefault(context->host_resolver());
329 } 329 }
330 330
331 storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_)); 331 storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_));
332 332
333 if (cookie_store_) { 333 if (cookie_store_) {
334 storage->set_cookie_store(cookie_store_.get()); 334 storage->set_cookie_store(std::move(cookie_store_));
335 storage->set_channel_id_service(std::move(channel_id_service_)); 335 storage->set_channel_id_service(std::move(channel_id_service_));
336 } else { 336 } else {
337 storage->set_cookie_store(new CookieMonster(NULL, NULL)); 337 storage->set_cookie_store(
338 make_scoped_ptr(new CookieMonster(nullptr, nullptr)));
338 // TODO(mmenke): This always creates a file thread, even when it ends up 339 // TODO(mmenke): This always creates a file thread, even when it ends up
339 // not being used. Consider lazily creating the thread. 340 // not being used. Consider lazily creating the thread.
340 storage->set_channel_id_service(make_scoped_ptr(new ChannelIDService( 341 storage->set_channel_id_service(make_scoped_ptr(new ChannelIDService(
341 new DefaultChannelIDStore(NULL), context->GetFileTaskRunner()))); 342 new DefaultChannelIDStore(NULL), context->GetFileTaskRunner())));
342 } 343 }
343 344
344 if (sdch_enabled_) { 345 if (sdch_enabled_) {
345 storage->set_sdch_manager(scoped_ptr<net::SdchManager>(new SdchManager())); 346 storage->set_sdch_manager(scoped_ptr<net::SdchManager>(new SdchManager()));
346 } 347 }
347 348
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 487 }
487 url_request_interceptors_.clear(); 488 url_request_interceptors_.clear();
488 } 489 }
489 storage->set_job_factory(std::move(top_job_factory)); 490 storage->set_job_factory(std::move(top_job_factory));
490 // TODO(willchan): Support sdch. 491 // TODO(willchan): Support sdch.
491 492
492 return std::move(context); 493 return std::move(context);
493 } 494 }
494 495
495 } // namespace net 496 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698