OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/engine/browser/blimp_url_request_context_getter.h" | 5 #include "blimp/engine/browser/blimp_url_request_context_getter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 mapped_host_resolver->SetRulesFromString( | 173 mapped_host_resolver->SetRulesFromString( |
174 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); | 174 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); |
175 host_resolver = mapped_host_resolver.Pass(); | 175 host_resolver = mapped_host_resolver.Pass(); |
176 } | 176 } |
177 | 177 |
178 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. | 178 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. |
179 storage_->set_host_resolver(host_resolver.Pass()); | 179 storage_->set_host_resolver(host_resolver.Pass()); |
180 network_session_params.host_resolver = | 180 network_session_params.host_resolver = |
181 url_request_context_->host_resolver(); | 181 url_request_context_->host_resolver(); |
182 | 182 |
183 storage_->set_http_transaction_factory( | 183 storage_->set_http_network_session( |
184 make_scoped_ptr( | 184 make_scoped_ptr(new net::HttpNetworkSession(network_session_params))); |
185 new net::HttpCache(network_session_params, main_backend)) | 185 storage_->set_http_transaction_factory(make_scoped_ptr(new net::HttpCache( |
186 .Pass()); | 186 storage_->http_network_session(), main_backend, true))); |
187 | 187 |
188 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 188 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
189 new net::URLRequestJobFactoryImpl()); | 189 new net::URLRequestJobFactoryImpl()); |
190 // Keep ProtocolHandlers added in sync with | 190 // Keep ProtocolHandlers added in sync with |
191 // BlimpContentBrowserClient::IsHandledURL(). | 191 // BlimpContentBrowserClient::IsHandledURL(). |
192 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 192 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
193 bool set_protocol = job_factory->SetProtocolHandler( | 193 bool set_protocol = job_factory->SetProtocolHandler( |
194 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); | 194 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); |
195 DCHECK(set_protocol); | 195 DCHECK(set_protocol); |
196 | 196 |
(...skipping 18 matching lines...) Expand all Loading... |
215 return content::BrowserThread::GetMessageLoopProxyForThread( | 215 return content::BrowserThread::GetMessageLoopProxyForThread( |
216 content::BrowserThread::IO); | 216 content::BrowserThread::IO); |
217 } | 217 } |
218 | 218 |
219 net::HostResolver* BlimpURLRequestContextGetter::host_resolver() { | 219 net::HostResolver* BlimpURLRequestContextGetter::host_resolver() { |
220 return url_request_context_->host_resolver(); | 220 return url_request_context_->host_resolver(); |
221 } | 221 } |
222 | 222 |
223 } // namespace engine | 223 } // namespace engine |
224 } // namespace blimp | 224 } // namespace blimp |
OLD | NEW |