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/dns/mojo_host_resolver_impl.h" | 5 #include "net/dns/mojo_host_resolver_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/dns/host_resolver.h" | 11 #include "net/dns/host_resolver.h" |
12 #include "net/dns/mojo_type_converters.h" | 12 #include "net/dns/mojo_host_type_converters.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // Handles host resolution for a single request and sends a response when done. | 16 // Handles host resolution for a single request and sends a response when done. |
17 // Also detects connection errors for HostResolverRequestClient and cancels the | 17 // Also detects connection errors for HostResolverRequestClient and cancels the |
18 // outstanding resolve request. Owned by MojoHostResolverImpl. | 18 // outstanding resolve request. Owned by MojoHostResolverImpl. |
19 class MojoHostResolverImpl::Job : public mojo::ErrorHandler { | 19 class MojoHostResolverImpl::Job : public mojo::ErrorHandler { |
20 public: | 20 public: |
21 Job(MojoHostResolverImpl* resolver_service, | 21 Job(MojoHostResolverImpl* resolver_service, |
22 net::HostResolver* resolver, | 22 net::HostResolver* resolver, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void MojoHostResolverImpl::Job::OnConnectionError() { | 121 void MojoHostResolverImpl::Job::OnConnectionError() { |
122 DCHECK(thread_checker_.CalledOnValidThread()); | 122 DCHECK(thread_checker_.CalledOnValidThread()); |
123 // |resolver_service_| should always outlive us. | 123 // |resolver_service_| should always outlive us. |
124 DCHECK(resolver_service_); | 124 DCHECK(resolver_service_); |
125 DVLOG(1) << "Connection error on request for " | 125 DVLOG(1) << "Connection error on request for " |
126 << request_info_.host_port_pair().ToString(); | 126 << request_info_.host_port_pair().ToString(); |
127 resolver_service_->DeleteJob(this); | 127 resolver_service_->DeleteJob(this); |
128 } | 128 } |
129 | 129 |
130 } // namespace net | 130 } // namespace net |
OLD | NEW |