| 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_impl.h" | 5 #include "net/proxy/mojo_proxy_resolver_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 bool done_; | 44 bool done_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(Job); | 46 DISALLOW_COPY_AND_ASSIGN(Job); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 MojoProxyResolverImpl::MojoProxyResolverImpl( | 49 MojoProxyResolverImpl::MojoProxyResolverImpl( |
| 50 std::unique_ptr<ProxyResolverV8Tracing> resolver) | 50 std::unique_ptr<ProxyResolverV8Tracing> resolver) |
| 51 : resolver_(std::move(resolver)) {} | 51 : resolver_(std::move(resolver)) {} |
| 52 | 52 |
| 53 MojoProxyResolverImpl::~MojoProxyResolverImpl() { | 53 MojoProxyResolverImpl::~MojoProxyResolverImpl() { |
| 54 STLDeleteElements(&resolve_jobs_); | 54 base::STLDeleteElements(&resolve_jobs_); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void MojoProxyResolverImpl::GetProxyForUrl( | 57 void MojoProxyResolverImpl::GetProxyForUrl( |
| 58 const GURL& url, | 58 const GURL& url, |
| 59 interfaces::ProxyResolverRequestClientPtr client) { | 59 interfaces::ProxyResolverRequestClientPtr client) { |
| 60 DVLOG(1) << "GetProxyForUrl(" << url << ")"; | 60 DVLOG(1) << "GetProxyForUrl(" << url << ")"; |
| 61 Job* job = new Job(std::move(client), this, url); | 61 Job* job = new Job(std::move(client), this, url); |
| 62 bool inserted = resolve_jobs_.insert(job).second; | 62 bool inserted = resolve_jobs_.insert(job).second; |
| 63 DCHECK(inserted); | 63 DCHECK(inserted); |
| 64 job->Start(); | 64 job->Start(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 client_->ReportResult(error, std::move(result)); | 110 client_->ReportResult(error, std::move(result)); |
| 111 resolver_->DeleteJob(this); | 111 resolver_->DeleteJob(this); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void MojoProxyResolverImpl::Job::OnConnectionError() { | 114 void MojoProxyResolverImpl::Job::OnConnectionError() { |
| 115 resolver_->DeleteJob(this); | 115 resolver_->DeleteJob(this); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace net | 118 } // namespace net |
| OLD | NEW |