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 "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 Loading... |
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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 context->set_backoff_manager(globals->url_request_backoff_manager.get()); | 1494 context->set_backoff_manager(globals->url_request_backoff_manager.get()); |
1494 | 1495 |
1495 context->set_http_server_properties( | 1496 context->set_http_server_properties( |
1496 globals->http_server_properties->GetWeakPtr()); | 1497 globals->http_server_properties->GetWeakPtr()); |
1497 | 1498 |
1498 net::HttpNetworkSession::Params system_params; | 1499 net::HttpNetworkSession::Params system_params; |
1499 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); | 1500 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); |
1500 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 1501 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1501 context, &system_params); | 1502 context, &system_params); |
1502 | 1503 |
| 1504 globals->system_http_network_session.reset( |
| 1505 new net::HttpNetworkSession(system_params)); |
1503 globals->system_http_transaction_factory.reset( | 1506 globals->system_http_transaction_factory.reset( |
1504 new net::HttpNetworkLayer(new net::HttpNetworkSession(system_params))); | 1507 new net::HttpNetworkLayer(globals->system_http_network_session.get())); |
1505 context->set_http_transaction_factory( | 1508 context->set_http_transaction_factory( |
1506 globals->system_http_transaction_factory.get()); | 1509 globals->system_http_transaction_factory.get()); |
1507 | 1510 |
1508 return context; | 1511 return context; |
1509 } | 1512 } |
1510 | 1513 |
1511 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( | 1514 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( |
1512 IOThread::Globals* globals, | 1515 IOThread::Globals* globals, |
1513 net::NetLog* net_log) { | 1516 net::NetLog* net_log) { |
1514 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 1517 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
(...skipping 29 matching lines...) Expand all Loading... |
1544 net::HttpNetworkSession::Params session_params; | 1547 net::HttpNetworkSession::Params session_params; |
1545 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params); | 1548 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params); |
1546 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 1549 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1547 context, &session_params); | 1550 context, &session_params); |
1548 | 1551 |
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_profile2( | 1554 tracked_objects::ScopedTracker tracking_profile2( |
1552 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1555 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
1553 "466432 IOThread::ConstructProxyScriptFetcherContext2")); | 1556 "466432 IOThread::ConstructProxyScriptFetcherContext2")); |
1554 scoped_refptr<net::HttpNetworkSession> network_session( | 1557 globals->proxy_script_fetcher_http_network_session.reset( |
1555 new net::HttpNetworkSession(session_params)); | 1558 new net::HttpNetworkSession(session_params)); |
1556 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 1559 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
1557 // is fixed. | 1560 // is fixed. |
1558 tracked_objects::ScopedTracker tracking_profile3( | 1561 tracked_objects::ScopedTracker tracking_profile3( |
1559 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1562 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
1560 "466432 IOThread::ConstructProxyScriptFetcherContext3")); | 1563 "466432 IOThread::ConstructProxyScriptFetcherContext3")); |
1561 globals->proxy_script_fetcher_http_transaction_factory | 1564 globals->proxy_script_fetcher_http_transaction_factory.reset( |
1562 .reset(new net::HttpNetworkLayer(network_session.get())); | 1565 new net::HttpNetworkLayer( |
| 1566 globals->proxy_script_fetcher_http_network_session.get())); |
1563 context->set_http_transaction_factory( | 1567 context->set_http_transaction_factory( |
1564 globals->proxy_script_fetcher_http_transaction_factory.get()); | 1568 globals->proxy_script_fetcher_http_transaction_factory.get()); |
1565 | 1569 |
1566 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 1570 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
1567 new net::URLRequestJobFactoryImpl()); | 1571 new net::URLRequestJobFactoryImpl()); |
1568 | 1572 |
1569 job_factory->SetProtocolHandler( | 1573 job_factory->SetProtocolHandler( |
1570 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); | 1574 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); |
1571 job_factory->SetProtocolHandler( | 1575 job_factory->SetProtocolHandler( |
1572 url::kFileScheme, | 1576 url::kFileScheme, |
(...skipping 12 matching lines...) Expand all Loading... |
1585 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1589 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1586 | 1590 |
1587 context->set_job_factory( | 1591 context->set_job_factory( |
1588 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1592 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1589 | 1593 |
1590 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1594 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1591 // system URLRequestContext too. There's no reason this should be tied to a | 1595 // system URLRequestContext too. There's no reason this should be tied to a |
1592 // profile. | 1596 // profile. |
1593 return context; | 1597 return context; |
1594 } | 1598 } |
OLD | NEW |