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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 net::CACHE_BACKEND_DEFAULT, | 137 net::CACHE_BACKEND_DEFAULT, |
138 cache_path, 0, cache_task_runner_)); | 138 cache_path, 0, cache_task_runner_)); |
139 | 139 |
140 storage_->set_http_network_session( | 140 storage_->set_http_network_session( |
141 base::WrapUnique(new net::HttpNetworkSession(network_session_params))); | 141 base::WrapUnique(new net::HttpNetworkSession(network_session_params))); |
142 storage_->set_http_transaction_factory(base::WrapUnique(new net::HttpCache( | 142 storage_->set_http_transaction_factory(base::WrapUnique(new net::HttpCache( |
143 storage_->http_network_session(), std::move(main_backend), | 143 storage_->http_network_session(), std::move(main_backend), |
144 true /* set_up_quic_server_info */))); | 144 true /* set_up_quic_server_info */))); |
145 | 145 |
146 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 146 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( |
147 new net::URLRequestJobFactoryImpl()); | 147 net::URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers()); |
148 bool set_protocol = job_factory->SetProtocolHandler( | 148 bool set_protocol = job_factory->SetProtocolHandler( |
149 "data", base::WrapUnique(new net::DataProtocolHandler)); | 149 "data", base::WrapUnique(new net::DataProtocolHandler)); |
150 DCHECK(set_protocol); | 150 DCHECK(set_protocol); |
151 | 151 |
152 storage_->set_job_factory(std::move(job_factory)); | 152 storage_->set_job_factory(std::move(job_factory)); |
153 } | 153 } |
154 | 154 |
155 return url_request_context_.get(); | 155 return url_request_context_.get(); |
156 } | 156 } |
157 | 157 |
158 scoped_refptr<base::SingleThreadTaskRunner> | 158 scoped_refptr<base::SingleThreadTaskRunner> |
159 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 159 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
160 return network_task_runner_; | 160 return network_task_runner_; |
161 } | 161 } |
162 | 162 |
163 } // namespace web | 163 } // namespace web |
OLD | NEW |