| 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/host_resolver_mojo.h" | 5 #include "net/dns/host_resolver_mojo.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "net/base/address_list.h" | 11 #include "net/base/address_list.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/dns/mojo_host_type_converters.h" | 13 #include "net/dns/mojo_host_type_converters.h" |
| 14 #include "net/log/net_log.h" | |
| 15 | 14 |
| 16 namespace net { | 15 namespace net { |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 // Default TTL for successful host resolutions. | 18 // Default TTL for successful host resolutions. |
| 20 const int kCacheEntryTTLSeconds = 5; | 19 const int kCacheEntryTTLSeconds = 5; |
| 21 | 20 |
| 22 // Default TTL for unsuccessful host resolutions. | 21 // Default TTL for unsuccessful host resolutions. |
| 23 const int kNegativeCacheEntryTTLSeconds = 0; | 22 const int kNegativeCacheEntryTTLSeconds = 0; |
| 24 | 23 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (binding_.is_bound()) | 156 if (binding_.is_bound()) |
| 158 binding_.Close(); | 157 binding_.Close(); |
| 159 base::ResetAndReturn(&callback_).Run(error); | 158 base::ResetAndReturn(&callback_).Run(error); |
| 160 } | 159 } |
| 161 | 160 |
| 162 void HostResolverMojo::Job::OnConnectionError() { | 161 void HostResolverMojo::Job::OnConnectionError() { |
| 163 ReportResult(ERR_FAILED, interfaces::AddressListPtr()); | 162 ReportResult(ERR_FAILED, interfaces::AddressListPtr()); |
| 164 } | 163 } |
| 165 | 164 |
| 166 } // namespace net | 165 } // namespace net |
| OLD | NEW |