| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 new net::HttpNetworkSession(session_params)); | 1042 new net::HttpNetworkSession(session_params)); |
| 1043 globals->proxy_script_fetcher_http_transaction_factory.reset( | 1043 globals->proxy_script_fetcher_http_transaction_factory.reset( |
| 1044 new net::HttpNetworkLayer( | 1044 new net::HttpNetworkLayer( |
| 1045 globals->proxy_script_fetcher_http_network_session.get())); | 1045 globals->proxy_script_fetcher_http_network_session.get())); |
| 1046 context->set_http_transaction_factory( | 1046 context->set_http_transaction_factory( |
| 1047 globals->proxy_script_fetcher_http_transaction_factory.get()); | 1047 globals->proxy_script_fetcher_http_transaction_factory.get()); |
| 1048 | 1048 |
| 1049 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 1049 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 1050 new net::URLRequestJobFactoryImpl()); | 1050 new net::URLRequestJobFactoryImpl()); |
| 1051 | 1051 |
| 1052 job_factory->SetProtocolHandler( | 1052 job_factory->SetProtocolHandler(url::kDataScheme, |
| 1053 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); | 1053 base::MakeUnique<net::DataProtocolHandler>()); |
| 1054 job_factory->SetProtocolHandler( | 1054 job_factory->SetProtocolHandler( |
| 1055 url::kFileScheme, | 1055 url::kFileScheme, |
| 1056 base::WrapUnique(new net::FileProtocolHandler( | 1056 base::MakeUnique<net::FileProtocolHandler>( |
| 1057 content::BrowserThread::GetBlockingPool() | 1057 content::BrowserThread::GetBlockingPool() |
| 1058 ->GetTaskRunnerWithShutdownBehavior( | 1058 ->GetTaskRunnerWithShutdownBehavior( |
| 1059 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); | 1059 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| 1060 #if !defined(DISABLE_FTP_SUPPORT) | 1060 #if !defined(DISABLE_FTP_SUPPORT) |
| 1061 globals->proxy_script_fetcher_ftp_transaction_factory.reset( | 1061 globals->proxy_script_fetcher_ftp_transaction_factory.reset( |
| 1062 new net::FtpNetworkLayer(globals->host_resolver.get())); | 1062 new net::FtpNetworkLayer(globals->host_resolver.get())); |
| 1063 job_factory->SetProtocolHandler( | 1063 job_factory->SetProtocolHandler( |
| 1064 url::kFtpScheme, | 1064 url::kFtpScheme, |
| 1065 base::WrapUnique(new net::FtpProtocolHandler( | 1065 base::MakeUnique<net::FtpProtocolHandler>( |
| 1066 globals->proxy_script_fetcher_ftp_transaction_factory.get()))); | 1066 globals->proxy_script_fetcher_ftp_transaction_factory.get())); |
| 1067 #endif | 1067 #endif |
| 1068 globals->proxy_script_fetcher_url_request_job_factory = | 1068 globals->proxy_script_fetcher_url_request_job_factory = |
| 1069 std::move(job_factory); | 1069 std::move(job_factory); |
| 1070 | 1070 |
| 1071 context->set_job_factory( | 1071 context->set_job_factory( |
| 1072 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1072 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1073 | 1073 |
| 1074 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1074 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1075 // system URLRequestContext too. There's no reason this should be tied to a | 1075 // system URLRequestContext too. There's no reason this should be tied to a |
| 1076 // profile. | 1076 // profile. |
| 1077 return context; | 1077 return context; |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 const metrics::UpdateUsagePrefCallbackType& | 1080 const metrics::UpdateUsagePrefCallbackType& |
| 1081 IOThread::GetMetricsDataUseForwarder() { | 1081 IOThread::GetMetricsDataUseForwarder() { |
| 1082 return metrics_data_use_forwarder_; | 1082 return metrics_data_use_forwarder_; |
| 1083 } | 1083 } |
| OLD | NEW |