OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/shell/shell_url_request_context_getter.h" | 5 #include "ios/web/shell/shell_url_request_context_getter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 net::CACHE_BACKEND_DEFAULT, | 152 net::CACHE_BACKEND_DEFAULT, |
153 cache_path, 0, cache_task_runner_)); | 153 cache_path, 0, cache_task_runner_)); |
154 | 154 |
155 storage_->set_http_network_session( | 155 storage_->set_http_network_session( |
156 base::MakeUnique<net::HttpNetworkSession>(network_session_params)); | 156 base::MakeUnique<net::HttpNetworkSession>(network_session_params)); |
157 storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( | 157 storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( |
158 storage_->http_network_session(), std::move(main_backend), | 158 storage_->http_network_session(), std::move(main_backend), |
159 true /* set_up_quic_server_info */)); | 159 true /* set_up_quic_server_info */)); |
160 | 160 |
161 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 161 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( |
162 new net::URLRequestJobFactoryImpl()); | 162 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers()); |
163 bool set_protocol = job_factory->SetProtocolHandler( | 163 bool set_protocol = job_factory->SetProtocolHandler( |
164 "data", base::WrapUnique(new net::DataProtocolHandler)); | 164 "data", base::WrapUnique(new net::DataProtocolHandler)); |
165 DCHECK(set_protocol); | 165 DCHECK(set_protocol); |
166 | 166 |
167 storage_->set_job_factory(std::move(job_factory)); | 167 storage_->set_job_factory(std::move(job_factory)); |
168 } | 168 } |
169 | 169 |
170 return url_request_context_.get(); | 170 return url_request_context_.get(); |
171 } | 171 } |
172 | 172 |
173 scoped_refptr<base::SingleThreadTaskRunner> | 173 scoped_refptr<base::SingleThreadTaskRunner> |
174 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 174 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
175 return network_task_runner_; | 175 return network_task_runner_; |
176 } | 176 } |
177 | 177 |
178 } // namespace web | 178 } // namespace web |
OLD | NEW |