| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell_url_request_context_getter.h" | 5 #include "content/shell/browser/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" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 200 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 201 new net::URLRequestJobFactoryImpl()); | 201 new net::URLRequestJobFactoryImpl()); |
| 202 // Keep ProtocolHandlers added in sync with | 202 // Keep ProtocolHandlers added in sync with |
| 203 // ShellContentBrowserClient::IsHandledURL(). | 203 // ShellContentBrowserClient::IsHandledURL(). |
| 204 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 204 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
| 205 bool set_protocol = job_factory->SetProtocolHandler( | 205 bool set_protocol = job_factory->SetProtocolHandler( |
| 206 chrome::kDataScheme, | 206 chrome::kDataScheme, |
| 207 new net::DataProtocolHandler); | 207 new net::DataProtocolHandler); |
| 208 DCHECK(set_protocol); | 208 DCHECK(set_protocol); |
| 209 set_protocol = job_factory->SetProtocolHandler( | 209 set_protocol = job_factory->SetProtocolHandler( |
| 210 chrome::kFileScheme, | 210 kFileScheme, |
| 211 new net::FileProtocolHandler( | 211 new net::FileProtocolHandler( |
| 212 content::BrowserThread::GetBlockingPool()-> | 212 content::BrowserThread::GetBlockingPool()-> |
| 213 GetTaskRunnerWithShutdownBehavior( | 213 GetTaskRunnerWithShutdownBehavior( |
| 214 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 214 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| 215 DCHECK(set_protocol); | 215 DCHECK(set_protocol); |
| 216 storage_->set_job_factory(job_factory.release()); | 216 storage_->set_job_factory(job_factory.release()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 return url_request_context_.get(); | 219 return url_request_context_.get(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 scoped_refptr<base::SingleThreadTaskRunner> | 222 scoped_refptr<base::SingleThreadTaskRunner> |
| 223 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 223 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 224 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 224 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 225 } | 225 } |
| 226 | 226 |
| 227 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 227 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
| 228 return url_request_context_->host_resolver(); | 228 return url_request_context_->host_resolver(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace content | 231 } // namespace content |
| OLD | NEW |