| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "net/dns/host_resolver_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Winsock2.h> | 8 #include <Winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "net/dns/dns_transaction.h" | 54 #include "net/dns/dns_transaction.h" |
| 55 #include "net/dns/dns_util.h" | 55 #include "net/dns/dns_util.h" |
| 56 #include "net/dns/host_resolver_proc.h" | 56 #include "net/dns/host_resolver_proc.h" |
| 57 #include "net/log/net_log.h" | 57 #include "net/log/net_log.h" |
| 58 #include "net/log/net_log_capture_mode.h" | 58 #include "net/log/net_log_capture_mode.h" |
| 59 #include "net/log/net_log_event_type.h" | 59 #include "net/log/net_log_event_type.h" |
| 60 #include "net/log/net_log_parameters_callback.h" | 60 #include "net/log/net_log_parameters_callback.h" |
| 61 #include "net/log/net_log_source.h" | 61 #include "net/log/net_log_source.h" |
| 62 #include "net/log/net_log_source_type.h" | 62 #include "net/log/net_log_source_type.h" |
| 63 #include "net/log/net_log_with_source.h" | 63 #include "net/log/net_log_with_source.h" |
| 64 #include "net/log/trace_constants.h" |
| 64 #include "net/socket/client_socket_factory.h" | 65 #include "net/socket/client_socket_factory.h" |
| 65 #include "net/socket/datagram_client_socket.h" | 66 #include "net/socket/datagram_client_socket.h" |
| 66 #include "url/url_canon_ip.h" | 67 #include "url/url_canon_ip.h" |
| 67 | 68 |
| 68 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| 69 #include "net/base/winsock_init.h" | 70 #include "net/base/winsock_init.h" |
| 70 #endif | 71 #endif |
| 71 | 72 |
| 72 namespace net { | 73 namespace net { |
| 73 | 74 |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 params_.unresponsive_delay *= params_.retry_factor; | 764 params_.unresponsive_delay *= params_.retry_factor; |
| 764 StartLookupAttempt(); | 765 StartLookupAttempt(); |
| 765 } | 766 } |
| 766 | 767 |
| 767 // Callback for when DoLookup() completes (runs on task runner thread). | 768 // Callback for when DoLookup() completes (runs on task runner thread). |
| 768 void OnLookupComplete(const AddressList& results, | 769 void OnLookupComplete(const AddressList& results, |
| 769 const base::TimeTicks& start_time, | 770 const base::TimeTicks& start_time, |
| 770 const uint32_t attempt_number, | 771 const uint32_t attempt_number, |
| 771 int error, | 772 int error, |
| 772 const int os_error) { | 773 const int os_error) { |
| 773 TRACE_EVENT0("net", "ProcTask::OnLookupComplete"); | 774 TRACE_EVENT0(kNetTracingCategory, "ProcTask::OnLookupComplete"); |
| 774 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 775 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
| 775 // If results are empty, we should return an error. | 776 // If results are empty, we should return an error. |
| 776 bool empty_list_on_ok = (error == OK && results.empty()); | 777 bool empty_list_on_ok = (error == OK && results.empty()); |
| 777 UMA_HISTOGRAM_BOOLEAN("DNS.EmptyAddressListAndNoError", empty_list_on_ok); | 778 UMA_HISTOGRAM_BOOLEAN("DNS.EmptyAddressListAndNoError", empty_list_on_ok); |
| 778 if (empty_list_on_ok) | 779 if (empty_list_on_ok) |
| 779 error = ERR_NAME_NOT_RESOLVED; | 780 error = ERR_NAME_NOT_RESOLVED; |
| 780 | 781 |
| 781 bool was_retry_attempt = attempt_number > 1; | 782 bool was_retry_attempt = attempt_number > 1; |
| 782 | 783 |
| 783 // Ideally the following code would be part of host_resolver_proc.cc, | 784 // Ideally the following code would be part of host_resolver_proc.cc, |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 if (job_) | 2610 if (job_) |
| 2610 job_->CancelRequest(this); | 2611 job_->CancelRequest(this); |
| 2611 } | 2612 } |
| 2612 | 2613 |
| 2613 void HostResolverImpl::RequestImpl::ChangeRequestPriority( | 2614 void HostResolverImpl::RequestImpl::ChangeRequestPriority( |
| 2614 RequestPriority priority) { | 2615 RequestPriority priority) { |
| 2615 job_->ChangeRequestPriority(this, priority); | 2616 job_->ChangeRequestPriority(this, priority); |
| 2616 } | 2617 } |
| 2617 | 2618 |
| 2618 } // namespace net | 2619 } // namespace net |
| OLD | NEW |