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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed too much, back up a bit 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
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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "net/cert/multi_log_ct_verifier.h" 63 #include "net/cert/multi_log_ct_verifier.h"
64 #include "net/cert/multi_threaded_cert_verifier.h" 64 #include "net/cert/multi_threaded_cert_verifier.h"
65 #include "net/cookies/cookie_store.h" 65 #include "net/cookies/cookie_store.h"
66 #include "net/dns/host_cache.h" 66 #include "net/dns/host_cache.h"
67 #include "net/dns/host_resolver.h" 67 #include "net/dns/host_resolver.h"
68 #include "net/dns/mapped_host_resolver.h" 68 #include "net/dns/mapped_host_resolver.h"
69 #include "net/ftp/ftp_network_layer.h" 69 #include "net/ftp/ftp_network_layer.h"
70 #include "net/http/http_auth_filter.h" 70 #include "net/http/http_auth_filter.h"
71 #include "net/http/http_auth_handler_factory.h" 71 #include "net/http/http_auth_handler_factory.h"
72 #include "net/http/http_network_layer.h" 72 #include "net/http/http_network_layer.h"
73 #include "net/http/http_network_session.h"
73 #include "net/http/http_server_properties_impl.h" 74 #include "net/http/http_server_properties_impl.h"
74 #include "net/proxy/proxy_config_service.h" 75 #include "net/proxy/proxy_config_service.h"
75 #include "net/proxy/proxy_script_fetcher_impl.h" 76 #include "net/proxy/proxy_script_fetcher_impl.h"
76 #include "net/proxy/proxy_service.h" 77 #include "net/proxy/proxy_service.h"
77 #include "net/quic/crypto/crypto_protocol.h" 78 #include "net/quic/crypto/crypto_protocol.h"
78 #include "net/quic/quic_protocol.h" 79 #include "net/quic/quic_protocol.h"
79 #include "net/quic/quic_utils.h" 80 #include "net/quic/quic_utils.h"
80 #include "net/socket/tcp_client_socket.h" 81 #include "net/socket/tcp_client_socket.h"
81 #include "net/spdy/spdy_session.h" 82 #include "net/spdy/spdy_session.h"
82 #include "net/ssl/channel_id_service.h" 83 #include "net/ssl/channel_id_service.h"
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 context->set_backoff_manager(globals->url_request_backoff_manager.get()); 1487 context->set_backoff_manager(globals->url_request_backoff_manager.get());
1487 1488
1488 context->set_http_server_properties( 1489 context->set_http_server_properties(
1489 globals->http_server_properties->GetWeakPtr()); 1490 globals->http_server_properties->GetWeakPtr());
1490 1491
1491 net::HttpNetworkSession::Params system_params; 1492 net::HttpNetworkSession::Params system_params;
1492 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); 1493 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params);
1493 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( 1494 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(
1494 context, &system_params); 1495 context, &system_params);
1495 1496
1497 globals->system_http_network_session.reset(
1498 new net::HttpNetworkSession(system_params));
1496 globals->system_http_transaction_factory.reset( 1499 globals->system_http_transaction_factory.reset(
1497 new net::HttpNetworkLayer(new net::HttpNetworkSession(system_params))); 1500 new net::HttpNetworkLayer(globals->system_http_network_session.get()));
1498 context->set_http_transaction_factory( 1501 context->set_http_transaction_factory(
1499 globals->system_http_transaction_factory.get()); 1502 globals->system_http_transaction_factory.get());
1500 1503
1501 return context; 1504 return context;
1502 } 1505 }
1503 1506
1504 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( 1507 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext(
1505 IOThread::Globals* globals, 1508 IOThread::Globals* globals,
1506 net::NetLog* net_log) { 1509 net::NetLog* net_log) {
1507 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 1510 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
(...skipping 29 matching lines...) Expand all
1537 net::HttpNetworkSession::Params session_params; 1540 net::HttpNetworkSession::Params session_params;
1538 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params); 1541 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params);
1539 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( 1542 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(
1540 context, &session_params); 1543 context, &session_params);
1541 1544
1542 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 1545 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
1543 // is fixed. 1546 // is fixed.
1544 tracked_objects::ScopedTracker tracking_profile2( 1547 tracked_objects::ScopedTracker tracking_profile2(
1545 FROM_HERE_WITH_EXPLICIT_FUNCTION( 1548 FROM_HERE_WITH_EXPLICIT_FUNCTION(
1546 "466432 IOThread::ConstructProxyScriptFetcherContext2")); 1549 "466432 IOThread::ConstructProxyScriptFetcherContext2"));
1547 scoped_refptr<net::HttpNetworkSession> network_session( 1550 globals->proxy_script_fetcher_http_network_session.reset(
1548 new net::HttpNetworkSession(session_params)); 1551 new net::HttpNetworkSession(session_params));
1549 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 1552 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
1550 // is fixed. 1553 // is fixed.
1551 tracked_objects::ScopedTracker tracking_profile3( 1554 tracked_objects::ScopedTracker tracking_profile3(
1552 FROM_HERE_WITH_EXPLICIT_FUNCTION( 1555 FROM_HERE_WITH_EXPLICIT_FUNCTION(
1553 "466432 IOThread::ConstructProxyScriptFetcherContext3")); 1556 "466432 IOThread::ConstructProxyScriptFetcherContext3"));
1554 globals->proxy_script_fetcher_http_transaction_factory 1557 globals->proxy_script_fetcher_http_transaction_factory.reset(
1555 .reset(new net::HttpNetworkLayer(network_session.get())); 1558 new net::HttpNetworkLayer(
1559 globals->proxy_script_fetcher_http_network_session.get()));
1556 context->set_http_transaction_factory( 1560 context->set_http_transaction_factory(
1557 globals->proxy_script_fetcher_http_transaction_factory.get()); 1561 globals->proxy_script_fetcher_http_transaction_factory.get());
1558 1562
1559 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( 1563 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
1560 new net::URLRequestJobFactoryImpl()); 1564 new net::URLRequestJobFactoryImpl());
1561 1565
1562 job_factory->SetProtocolHandler( 1566 job_factory->SetProtocolHandler(
1563 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); 1567 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler()));
1564 job_factory->SetProtocolHandler( 1568 job_factory->SetProtocolHandler(
1565 url::kFileScheme, 1569 url::kFileScheme,
(...skipping 12 matching lines...) Expand all
1578 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); 1582 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass();
1579 1583
1580 context->set_job_factory( 1584 context->set_job_factory(
1581 globals->proxy_script_fetcher_url_request_job_factory.get()); 1585 globals->proxy_script_fetcher_url_request_job_factory.get());
1582 1586
1583 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1587 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1584 // system URLRequestContext too. There's no reason this should be tied to a 1588 // system URLRequestContext too. There's no reason this should be tied to a
1585 // profile. 1589 // profile.
1586 return context; 1590 return context;
1587 } 1591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698