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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/debug/leak_tracker.h" | 13 #include "base/debug/leak_tracker.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
17 #include "base/prefs/pref_registry_simple.h" | 17 #include "base/prefs/pref_registry_simple.h" |
18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 23 #include "base/threading/sequenced_worker_pool.h" |
23 #include "base/threading/thread.h" | 24 #include "base/threading/thread.h" |
24 #include "base/threading/worker_pool.h" | 25 #include "base/threading/worker_pool.h" |
25 #include "base/time/default_tick_clock.h" | 26 #include "base/time/default_tick_clock.h" |
26 #include "build/build_config.h" | 27 #include "build/build_config.h" |
27 #include "chrome/browser/browser_process.h" | 28 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/extensions/event_router_forwarder.h" | 29 #include "chrome/browser/extensions/event_router_forwarder.h" |
29 #include "chrome/browser/net/async_dns_field_trial.h" | 30 #include "chrome/browser/net/async_dns_field_trial.h" |
30 #include "chrome/browser/net/basic_http_user_agent_settings.h" | 31 #include "chrome/browser/net/basic_http_user_agent_settings.h" |
31 #include "chrome/browser/net/chrome_net_log.h" | 32 #include "chrome/browser/net/chrome_net_log.h" |
32 #include "chrome/browser/net/chrome_network_delegate.h" | 33 #include "chrome/browser/net/chrome_network_delegate.h" |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:HttpNetworkSession"); | 588 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:HttpNetworkSession"); |
588 scoped_refptr<net::HttpNetworkSession> network_session( | 589 scoped_refptr<net::HttpNetworkSession> network_session( |
589 new net::HttpNetworkSession(session_params)); | 590 new net::HttpNetworkSession(session_params)); |
590 globals_->proxy_script_fetcher_http_transaction_factory | 591 globals_->proxy_script_fetcher_http_transaction_factory |
591 .reset(new net::HttpNetworkLayer(network_session.get())); | 592 .reset(new net::HttpNetworkLayer(network_session.get())); |
592 TRACE_EVENT_END0("startup", "IOThread::InitAsync:HttpNetworkSession"); | 593 TRACE_EVENT_END0("startup", "IOThread::InitAsync:HttpNetworkSession"); |
593 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 594 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
594 new net::URLRequestJobFactoryImpl()); | 595 new net::URLRequestJobFactoryImpl()); |
595 job_factory->SetProtocolHandler(chrome::kDataScheme, | 596 job_factory->SetProtocolHandler(chrome::kDataScheme, |
596 new net::DataProtocolHandler()); | 597 new net::DataProtocolHandler()); |
597 job_factory->SetProtocolHandler(chrome::kFileScheme, | 598 job_factory->SetProtocolHandler( |
598 new net::FileProtocolHandler()); | 599 chrome::kFileScheme, |
| 600 new net::FileProtocolHandler( |
| 601 content::BrowserThread::GetBlockingPool()-> |
| 602 GetTaskRunnerWithShutdownBehavior( |
| 603 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
599 #if !defined(DISABLE_FTP_SUPPORT) | 604 #if !defined(DISABLE_FTP_SUPPORT) |
600 globals_->proxy_script_fetcher_ftp_transaction_factory.reset( | 605 globals_->proxy_script_fetcher_ftp_transaction_factory.reset( |
601 new net::FtpNetworkLayer(globals_->host_resolver.get())); | 606 new net::FtpNetworkLayer(globals_->host_resolver.get())); |
602 job_factory->SetProtocolHandler( | 607 job_factory->SetProtocolHandler( |
603 chrome::kFtpScheme, | 608 chrome::kFtpScheme, |
604 new net::FtpProtocolHandler( | 609 new net::FtpProtocolHandler( |
605 globals_->proxy_script_fetcher_ftp_transaction_factory.get())); | 610 globals_->proxy_script_fetcher_ftp_transaction_factory.get())); |
606 #endif | 611 #endif |
607 globals_->proxy_script_fetcher_url_request_job_factory = | 612 globals_->proxy_script_fetcher_url_request_job_factory = |
608 job_factory.PassAs<net::URLRequestJobFactory>(); | 613 job_factory.PassAs<net::URLRequestJobFactory>(); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1015 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
1011 return false; | 1016 return false; |
1012 | 1017 |
1013 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1018 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
1014 return true; | 1019 return true; |
1015 | 1020 |
1016 // HTTPS over QUIC should only be enabled if we are in the https | 1021 // HTTPS over QUIC should only be enabled if we are in the https |
1017 // field trial group. | 1022 // field trial group. |
1018 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1023 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
1019 } | 1024 } |
OLD | NEW |