| 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/mojo_proxy_resolver_factory_impl.h" | 5 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 interfaces::ProxyResolverFactoryRequestClientPtr client) | 85 interfaces::ProxyResolverFactoryRequestClientPtr client) |
| 86 : parent_(factory), | 86 : parent_(factory), |
| 87 proxy_request_(std::move(request)), | 87 proxy_request_(std::move(request)), |
| 88 factory_(proxy_resolver_factory), | 88 factory_(proxy_resolver_factory), |
| 89 client_ptr_(std::move(client)) { | 89 client_ptr_(std::move(client)) { |
| 90 client_ptr_.set_connection_error_handler( | 90 client_ptr_.set_connection_error_handler( |
| 91 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnConnectionError, | 91 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnConnectionError, |
| 92 base::Unretained(this))); | 92 base::Unretained(this))); |
| 93 factory_->CreateProxyResolverV8Tracing( | 93 factory_->CreateProxyResolverV8Tracing( |
| 94 pac_script, | 94 pac_script, |
| 95 base::WrapUnique(new MojoProxyResolverV8TracingBindings< | 95 base::MakeUnique<MojoProxyResolverV8TracingBindings< |
| 96 interfaces::ProxyResolverFactoryRequestClient>( | 96 interfaces::ProxyResolverFactoryRequestClient>>(client_ptr_.get()), |
| 97 client_ptr_.get())), | |
| 98 &proxy_resolver_impl_, | 97 &proxy_resolver_impl_, |
| 99 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnProxyResolverCreated, | 98 base::Bind(&MojoProxyResolverFactoryImpl::Job::OnProxyResolverCreated, |
| 100 base::Unretained(this)), | 99 base::Unretained(this)), |
| 101 &request_); | 100 &request_); |
| 102 } | 101 } |
| 103 | 102 |
| 104 MojoProxyResolverFactoryImpl::Job::~Job() = default; | 103 MojoProxyResolverFactoryImpl::Job::~Job() = default; |
| 105 | 104 |
| 106 void MojoProxyResolverFactoryImpl::Job::OnConnectionError() { | 105 void MojoProxyResolverFactoryImpl::Job::OnConnectionError() { |
| 107 client_ptr_->ReportResult(ERR_PAC_SCRIPT_TERMINATED); | 106 client_ptr_->ReportResult(ERR_PAC_SCRIPT_TERMINATED); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 std::move(client))); | 145 std::move(client))); |
| 147 } | 146 } |
| 148 | 147 |
| 149 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) { | 148 void MojoProxyResolverFactoryImpl::RemoveJob(Job* job) { |
| 150 size_t erased = jobs_.erase(job); | 149 size_t erased = jobs_.erase(job); |
| 151 DCHECK_EQ(1u, erased); | 150 DCHECK_EQ(1u, erased); |
| 152 delete job; | 151 delete job; |
| 153 } | 152 } |
| 154 | 153 |
| 155 } // namespace net | 154 } // namespace net |
| OLD | NEW |