diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 13:14:29 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 13:14:29 +0000 |
commit | 255620da4ddf6f59947d9e77529f54ad02d9af12 (patch) | |
tree | 3259bcf1524fa26fd8099e409af35422d82f9871 /chrome/browser/io_thread.cc | |
parent | 6a1162f6cff7d33880f5e03fb9bb3909d84e7beb (diff) | |
download | chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.zip chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.tar.gz chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.tar.bz2 |
Remove WorkerPool dependency from URLRequestFileJob.
Make net::URLRequestFileJob pass a TaskRunner to FileStream, instead of using a deprecated FileStream constructor that depends on WorkerPool. This TaskRunner is obtained from the blocking pool where possible. Also, remove two explicit uses of WorkerPool in net/url_request/ and chrome/browser/.
Removes dependency on deprecated code. Also fixes memory leaks in unit tests caused by FileStream destruction tasks not running to completion in WorkerPool.
BUG=248513, 251774
Review URL: https://chromiumcodereview.appspot.com/22795006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r-- | chrome/browser/io_thread.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index d096e43..d2745b3 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -20,6 +20,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread.h" #include "base/threading/worker_pool.h" #include "base/time/default_tick_clock.h" @@ -594,8 +595,12 @@ void IOThread::InitAsync() { new net::URLRequestJobFactoryImpl()); job_factory->SetProtocolHandler(chrome::kDataScheme, new net::DataProtocolHandler()); - job_factory->SetProtocolHandler(chrome::kFileScheme, - new net::FileProtocolHandler()); + job_factory->SetProtocolHandler( + chrome::kFileScheme, + new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool()-> + GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); #if !defined(DISABLE_FTP_SUPPORT) globals_->proxy_script_fetcher_ftp_transaction_factory.reset( new net::FtpNetworkLayer(globals_->host_resolver.get())); |