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

Side by Side Diff: net/url_request/url_request_context_builder.cc

Issue 1342613002: Revert of Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « net/spdy/spdy_test_util_common.cc ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 http_network_session_params_.use_alternative_services; 380 http_network_session_params_.use_alternative_services;
381 network_session_params.trusted_spdy_proxy = 381 network_session_params.trusted_spdy_proxy =
382 http_network_session_params_.trusted_spdy_proxy; 382 http_network_session_params_.trusted_spdy_proxy;
383 network_session_params.next_protos = http_network_session_params_.next_protos; 383 network_session_params.next_protos = http_network_session_params_.next_protos;
384 network_session_params.enable_quic = http_network_session_params_.enable_quic; 384 network_session_params.enable_quic = http_network_session_params_.enable_quic;
385 network_session_params.enable_insecure_quic = 385 network_session_params.enable_insecure_quic =
386 http_network_session_params_.enable_insecure_quic; 386 http_network_session_params_.enable_insecure_quic;
387 network_session_params.quic_connection_options = 387 network_session_params.quic_connection_options =
388 http_network_session_params_.quic_connection_options; 388 http_network_session_params_.quic_connection_options;
389 389
390 storage->set_http_network_session( 390 HttpTransactionFactory* http_transaction_factory = NULL;
391 make_scoped_ptr(new HttpNetworkSession(network_session_params)));
392
393 HttpTransactionFactory* http_transaction_factory;
394 if (http_cache_enabled_) { 391 if (http_cache_enabled_) {
395 HttpCache::BackendFactory* http_cache_backend; 392 HttpCache::BackendFactory* http_cache_backend = NULL;
396 if (http_cache_params_.type == HttpCacheParams::DISK) { 393 if (http_cache_params_.type == HttpCacheParams::DISK) {
397 http_cache_backend = new HttpCache::DefaultBackend( 394 http_cache_backend = new HttpCache::DefaultBackend(
398 DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path, 395 DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path,
399 http_cache_params_.max_size, context->GetFileTaskRunner()); 396 http_cache_params_.max_size, context->GetFileTaskRunner());
400 } else { 397 } else {
401 http_cache_backend = 398 http_cache_backend =
402 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); 399 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size);
403 } 400 }
404 401
405 http_transaction_factory = new HttpCache(storage->http_network_session(), 402 http_transaction_factory = new HttpCache(
406 http_cache_backend, true); 403 network_session_params, http_cache_backend);
407 } else { 404 } else {
408 http_transaction_factory = 405 scoped_refptr<HttpNetworkSession> network_session(
409 new HttpNetworkLayer(storage->http_network_session()); 406 new HttpNetworkSession(network_session_params));
407
408 http_transaction_factory = new HttpNetworkLayer(network_session.get());
410 } 409 }
411 storage->set_http_transaction_factory(http_transaction_factory); 410 storage->set_http_transaction_factory(http_transaction_factory);
412 411
413 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl; 412 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl;
414 if (data_enabled_) 413 if (data_enabled_)
415 job_factory->SetProtocolHandler("data", 414 job_factory->SetProtocolHandler("data",
416 make_scoped_ptr(new DataProtocolHandler)); 415 make_scoped_ptr(new DataProtocolHandler));
417 416
418 #if !defined(DISABLE_FILE_SUPPORT) 417 #if !defined(DISABLE_FILE_SUPPORT)
419 if (file_enabled_) { 418 if (file_enabled_) {
(...skipping 25 matching lines...) Expand all
445 } 444 }
446 url_request_interceptors_.weak_clear(); 445 url_request_interceptors_.weak_clear();
447 } 446 }
448 storage->set_job_factory(top_job_factory.release()); 447 storage->set_job_factory(top_job_factory.release());
449 // TODO(willchan): Support sdch. 448 // TODO(willchan): Support sdch.
450 449
451 return context.Pass(); 450 return context.Pass();
452 } 451 }
453 452
454 } // namespace net 453 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_common.cc ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698