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 "content/shell/shell_url_request_context_getter.h" | 5 #include "content/shell/shell_url_request_context_getter.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" |
12 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
15 #include "content/public/common/url_constants.h" | 16 #include "content/public/common/url_constants.h" |
16 #include "content/shell/common/shell_switches.h" | 17 #include "content/shell/common/shell_switches.h" |
17 #include "content/shell/shell_network_delegate.h" | 18 #include "content/shell/shell_network_delegate.h" |
18 #include "net/base/cache_type.h" | 19 #include "net/base/cache_type.h" |
19 #include "net/cert/cert_verifier.h" | 20 #include "net/cert/cert_verifier.h" |
20 #include "net/cookies/cookie_monster.h" | 21 #include "net/cookies/cookie_monster.h" |
21 #include "net/dns/host_resolver.h" | 22 #include "net/dns/host_resolver.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 new net::URLRequestJobFactoryImpl()); | 201 new net::URLRequestJobFactoryImpl()); |
201 // Keep ProtocolHandlers added in sync with | 202 // Keep ProtocolHandlers added in sync with |
202 // ShellContentBrowserClient::IsHandledURL(). | 203 // ShellContentBrowserClient::IsHandledURL(). |
203 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 204 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
204 bool set_protocol = job_factory->SetProtocolHandler( | 205 bool set_protocol = job_factory->SetProtocolHandler( |
205 chrome::kDataScheme, | 206 chrome::kDataScheme, |
206 new net::DataProtocolHandler); | 207 new net::DataProtocolHandler); |
207 DCHECK(set_protocol); | 208 DCHECK(set_protocol); |
208 set_protocol = job_factory->SetProtocolHandler( | 209 set_protocol = job_factory->SetProtocolHandler( |
209 chrome::kFileScheme, | 210 chrome::kFileScheme, |
210 new net::FileProtocolHandler); | 211 new net::FileProtocolHandler( |
| 212 content::BrowserThread::GetBlockingPool()-> |
| 213 GetTaskRunnerWithShutdownBehavior( |
| 214 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
211 DCHECK(set_protocol); | 215 DCHECK(set_protocol); |
212 storage_->set_job_factory(job_factory.release()); | 216 storage_->set_job_factory(job_factory.release()); |
213 } | 217 } |
214 | 218 |
215 return url_request_context_.get(); | 219 return url_request_context_.get(); |
216 } | 220 } |
217 | 221 |
218 scoped_refptr<base::SingleThreadTaskRunner> | 222 scoped_refptr<base::SingleThreadTaskRunner> |
219 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 223 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
220 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 224 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
221 } | 225 } |
222 | 226 |
223 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 227 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
224 return url_request_context_->host_resolver(); | 228 return url_request_context_->host_resolver(); |
225 } | 229 } |
226 | 230 |
227 } // namespace content | 231 } // namespace content |
OLD | NEW |