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 "net/proxy/proxy_resolver_factory_mojo.h" | 5 #include "net/proxy/proxy_resolver_factory_mojo.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 factory->host_resolver_, | 298 factory->host_resolver_, |
299 error_observer.get(), | 299 error_observer.get(), |
300 factory->net_log_, | 300 factory->net_log_, |
301 NetLogWithSource()), | 301 NetLogWithSource()), |
302 factory_(factory), | 302 factory_(factory), |
303 resolver_(resolver), | 303 resolver_(resolver), |
304 callback_(callback), | 304 callback_(callback), |
305 binding_(this), | 305 binding_(this), |
306 error_observer_(std::move(error_observer)) { | 306 error_observer_(std::move(error_observer)) { |
307 on_delete_callback_runner_ = factory_->mojo_proxy_factory_->CreateResolver( | 307 on_delete_callback_runner_ = factory_->mojo_proxy_factory_->CreateResolver( |
308 base::UTF16ToUTF8(pac_script->utf16()), mojo::GetProxy(&resolver_ptr_), | 308 base::UTF16ToUTF8(pac_script->utf16()), |
| 309 mojo::MakeRequest(&resolver_ptr_), |
309 binding_.CreateInterfacePtrAndBind()); | 310 binding_.CreateInterfacePtrAndBind()); |
310 resolver_ptr_.set_connection_error_handler( | 311 resolver_ptr_.set_connection_error_handler( |
311 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError, | 312 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError, |
312 base::Unretained(this))); | 313 base::Unretained(this))); |
313 binding_.set_connection_error_handler( | 314 binding_.set_connection_error_handler( |
314 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError, | 315 base::Bind(&ProxyResolverFactoryMojo::Job::OnConnectionError, |
315 base::Unretained(this))); | 316 base::Unretained(this))); |
316 } | 317 } |
317 | 318 |
318 void OnConnectionError() { ReportResult(ERR_PAC_SCRIPT_TERMINATED); } | 319 void OnConnectionError() { ReportResult(ERR_PAC_SCRIPT_TERMINATED); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 return ERR_PAC_SCRIPT_FAILED; | 367 return ERR_PAC_SCRIPT_FAILED; |
367 } | 368 } |
368 request->reset(new Job(this, pac_script, resolver, callback, | 369 request->reset(new Job(this, pac_script, resolver, callback, |
369 error_observer_factory_.is_null() | 370 error_observer_factory_.is_null() |
370 ? nullptr | 371 ? nullptr |
371 : error_observer_factory_.Run())); | 372 : error_observer_factory_.Run())); |
372 return ERR_IO_PENDING; | 373 return ERR_IO_PENDING; |
373 } | 374 } |
374 | 375 |
375 } // namespace net | 376 } // namespace net |
OLD | NEW |