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" | |
74 #include "net/http/http_server_properties_impl.h" | 73 #include "net/http/http_server_properties_impl.h" |
75 #include "net/proxy/proxy_config_service.h" | 74 #include "net/proxy/proxy_config_service.h" |
76 #include "net/proxy/proxy_script_fetcher_impl.h" | 75 #include "net/proxy/proxy_script_fetcher_impl.h" |
77 #include "net/proxy/proxy_service.h" | 76 #include "net/proxy/proxy_service.h" |
78 #include "net/quic/crypto/crypto_protocol.h" | 77 #include "net/quic/crypto/crypto_protocol.h" |
79 #include "net/quic/quic_protocol.h" | 78 #include "net/quic/quic_protocol.h" |
80 #include "net/quic/quic_utils.h" | 79 #include "net/quic/quic_utils.h" |
81 #include "net/socket/tcp_client_socket.h" | 80 #include "net/socket/tcp_client_socket.h" |
82 #include "net/spdy/spdy_session.h" | 81 #include "net/spdy/spdy_session.h" |
83 #include "net/ssl/channel_id_service.h" | 82 #include "net/ssl/channel_id_service.h" |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 context->set_backoff_manager(globals->url_request_backoff_manager.get()); | 1486 context->set_backoff_manager(globals->url_request_backoff_manager.get()); |
1488 | 1487 |
1489 context->set_http_server_properties( | 1488 context->set_http_server_properties( |
1490 globals->http_server_properties->GetWeakPtr()); | 1489 globals->http_server_properties->GetWeakPtr()); |
1491 | 1490 |
1492 net::HttpNetworkSession::Params system_params; | 1491 net::HttpNetworkSession::Params system_params; |
1493 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); | 1492 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); |
1494 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 1493 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1495 context, &system_params); | 1494 context, &system_params); |
1496 | 1495 |
1497 globals->system_http_network_session.reset( | |
1498 new net::HttpNetworkSession(system_params)); | |
1499 globals->system_http_transaction_factory.reset( | 1496 globals->system_http_transaction_factory.reset( |
1500 new net::HttpNetworkLayer(globals->system_http_network_session.get())); | 1497 new net::HttpNetworkLayer(new net::HttpNetworkSession(system_params))); |
1501 context->set_http_transaction_factory( | 1498 context->set_http_transaction_factory( |
1502 globals->system_http_transaction_factory.get()); | 1499 globals->system_http_transaction_factory.get()); |
1503 | 1500 |
1504 return context; | 1501 return context; |
1505 } | 1502 } |
1506 | 1503 |
1507 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( | 1504 net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( |
1508 IOThread::Globals* globals, | 1505 IOThread::Globals* globals, |
1509 net::NetLog* net_log) { | 1506 net::NetLog* net_log) { |
1510 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 1507 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
(...skipping 29 matching lines...) Expand all Loading... |
1540 net::HttpNetworkSession::Params session_params; | 1537 net::HttpNetworkSession::Params session_params; |
1541 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params); | 1538 InitializeNetworkSessionParamsFromGlobals(*globals, &session_params); |
1542 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 1539 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1543 context, &session_params); | 1540 context, &session_params); |
1544 | 1541 |
1545 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 1542 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
1546 // is fixed. | 1543 // is fixed. |
1547 tracked_objects::ScopedTracker tracking_profile2( | 1544 tracked_objects::ScopedTracker tracking_profile2( |
1548 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1545 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
1549 "466432 IOThread::ConstructProxyScriptFetcherContext2")); | 1546 "466432 IOThread::ConstructProxyScriptFetcherContext2")); |
1550 globals->proxy_script_fetcher_http_network_session.reset( | 1547 scoped_refptr<net::HttpNetworkSession> network_session( |
1551 new net::HttpNetworkSession(session_params)); | 1548 new net::HttpNetworkSession(session_params)); |
1552 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 1549 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
1553 // is fixed. | 1550 // is fixed. |
1554 tracked_objects::ScopedTracker tracking_profile3( | 1551 tracked_objects::ScopedTracker tracking_profile3( |
1555 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1552 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
1556 "466432 IOThread::ConstructProxyScriptFetcherContext3")); | 1553 "466432 IOThread::ConstructProxyScriptFetcherContext3")); |
1557 globals->proxy_script_fetcher_http_transaction_factory.reset( | 1554 globals->proxy_script_fetcher_http_transaction_factory |
1558 new net::HttpNetworkLayer( | 1555 .reset(new net::HttpNetworkLayer(network_session.get())); |
1559 globals->proxy_script_fetcher_http_network_session.get())); | |
1560 context->set_http_transaction_factory( | 1556 context->set_http_transaction_factory( |
1561 globals->proxy_script_fetcher_http_transaction_factory.get()); | 1557 globals->proxy_script_fetcher_http_transaction_factory.get()); |
1562 | 1558 |
1563 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 1559 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
1564 new net::URLRequestJobFactoryImpl()); | 1560 new net::URLRequestJobFactoryImpl()); |
1565 | 1561 |
1566 job_factory->SetProtocolHandler( | 1562 job_factory->SetProtocolHandler( |
1567 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); | 1563 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); |
1568 job_factory->SetProtocolHandler( | 1564 job_factory->SetProtocolHandler( |
1569 url::kFileScheme, | 1565 url::kFileScheme, |
(...skipping 12 matching lines...) Expand all Loading... |
1582 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1578 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1583 | 1579 |
1584 context->set_job_factory( | 1580 context->set_job_factory( |
1585 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1581 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1586 | 1582 |
1587 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1583 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1588 // system URLRequestContext too. There's no reason this should be tied to a | 1584 // system URLRequestContext too. There's no reason this should be tied to a |
1589 // profile. | 1585 // profile. |
1590 return context; | 1586 return context; |
1591 } | 1587 } |
OLD | NEW |