| 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" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/debug/leak_tracker.h" | 15 #include "base/debug/leak_tracker.h" |
| 16 #include "base/environment.h" | 16 #include "base/environment.h" |
| 17 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "base/metrics/field_trial.h" | 21 #include "base/metrics/field_trial.h" |
| 22 #include "base/metrics/histogram_macros.h" | 22 #include "base/metrics/histogram_macros.h" |
| 23 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
| 24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_piece.h" | 25 #include "base/strings/string_piece.h" |
| 26 #include "base/strings/string_split.h" | 26 #include "base/strings/string_split.h" |
| 27 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/threading/sequenced_worker_pool.h" | 29 #include "base/task_scheduler/post_task.h" |
| 30 #include "base/threading/thread.h" | 30 #include "base/threading/thread.h" |
| 31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
| 32 #include "base/trace_event/trace_event.h" | 32 #include "base/trace_event/trace_event.h" |
| 33 #include "build/build_config.h" | 33 #include "build/build_config.h" |
| 34 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
| 35 #include "chrome/browser/data_usage/tab_id_annotator.h" | 35 #include "chrome/browser/data_usage/tab_id_annotator.h" |
| 36 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" | 36 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" |
| 37 #include "chrome/browser/net/async_dns_field_trial.h" | 37 #include "chrome/browser/net/async_dns_field_trial.h" |
| 38 #include "chrome/browser/net/chrome_network_delegate.h" | 38 #include "chrome/browser/net/chrome_network_delegate.h" |
| 39 #include "chrome/browser/net/dns_probe_service.h" | 39 #include "chrome/browser/net/dns_probe_service.h" |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 globals->proxy_script_fetcher_http_transaction_factory.get()); | 1073 globals->proxy_script_fetcher_http_transaction_factory.get()); |
| 1074 | 1074 |
| 1075 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 1075 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 1076 new net::URLRequestJobFactoryImpl()); | 1076 new net::URLRequestJobFactoryImpl()); |
| 1077 | 1077 |
| 1078 job_factory->SetProtocolHandler(url::kDataScheme, | 1078 job_factory->SetProtocolHandler(url::kDataScheme, |
| 1079 base::MakeUnique<net::DataProtocolHandler>()); | 1079 base::MakeUnique<net::DataProtocolHandler>()); |
| 1080 job_factory->SetProtocolHandler( | 1080 job_factory->SetProtocolHandler( |
| 1081 url::kFileScheme, | 1081 url::kFileScheme, |
| 1082 base::MakeUnique<net::FileProtocolHandler>( | 1082 base::MakeUnique<net::FileProtocolHandler>( |
| 1083 content::BrowserThread::GetBlockingPool() | 1083 base::CreateTaskRunnerWithTraits( |
| 1084 ->GetTaskRunnerWithShutdownBehavior( | 1084 base::TaskTraits() |
| 1085 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 1085 .MayBlock() |
| 1086 .WithPriority(base::TaskPriority::USER_VISIBLE) |
| 1087 .WithShutdownBehavior( |
| 1088 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))); |
| 1086 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) | 1089 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) |
| 1087 job_factory->SetProtocolHandler( | 1090 job_factory->SetProtocolHandler( |
| 1088 url::kFtpScheme, | 1091 url::kFtpScheme, |
| 1089 net::FtpProtocolHandler::Create(globals->host_resolver.get())); | 1092 net::FtpProtocolHandler::Create(globals->host_resolver.get())); |
| 1090 #endif | 1093 #endif |
| 1091 globals->proxy_script_fetcher_url_request_job_factory = | 1094 globals->proxy_script_fetcher_url_request_job_factory = |
| 1092 std::move(job_factory); | 1095 std::move(job_factory); |
| 1093 | 1096 |
| 1094 context->set_job_factory( | 1097 context->set_job_factory( |
| 1095 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1098 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1096 | 1099 |
| 1097 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1100 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1098 // system URLRequestContext too. There's no reason this should be tied to a | 1101 // system URLRequestContext too. There's no reason this should be tied to a |
| 1099 // profile. | 1102 // profile. |
| 1100 return context; | 1103 return context; |
| 1101 } | 1104 } |
| 1102 | 1105 |
| 1103 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { | 1106 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { |
| 1104 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); | 1107 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); |
| 1105 } | 1108 } |
| OLD | NEW |