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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // Map the error code to a human-readable string. | 300 // Map the error code to a human-readable string. |
301 LPWSTR error_string = NULL; | 301 LPWSTR error_string = NULL; |
302 int size = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | | 302 int size = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | |
303 FORMAT_MESSAGE_FROM_SYSTEM, | 303 FORMAT_MESSAGE_FROM_SYSTEM, |
304 0, // Use the internal message table. | 304 0, // Use the internal message table. |
305 os_error, | 305 os_error, |
306 0, // Use default language. | 306 0, // Use default language. |
307 (LPWSTR)&error_string, | 307 (LPWSTR)&error_string, |
308 0, // Buffer size. | 308 0, // Buffer size. |
309 0); // Arguments (unused). | 309 0); // Arguments (unused). |
310 dict->SetString("os_error_string", WideToUTF8(error_string)); | 310 dict->SetString("os_error_string", base::WideToUTF8(error_string)); |
311 LocalFree(error_string); | 311 LocalFree(error_string); |
312 #endif | 312 #endif |
313 } | 313 } |
314 | 314 |
315 return dict; | 315 return dict; |
316 } | 316 } |
317 | 317 |
318 // Creates NetLog parameters when the DnsTask failed. | 318 // Creates NetLog parameters when the DnsTask failed. |
319 base::Value* NetLogDnsTaskFailedCallback(int net_error, | 319 base::Value* NetLogDnsTaskFailedCallback(int net_error, |
320 int dns_error, | 320 int dns_error, |
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2347 dns_client_->SetConfig(dns_config); | 2347 dns_client_->SetConfig(dns_config); |
2348 num_dns_failures_ = 0; | 2348 num_dns_failures_ = 0; |
2349 if (dns_client_->GetConfig()) | 2349 if (dns_client_->GetConfig()) |
2350 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); | 2350 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); |
2351 } | 2351 } |
2352 | 2352 |
2353 AbortDnsTasks(); | 2353 AbortDnsTasks(); |
2354 } | 2354 } |
2355 | 2355 |
2356 } // namespace net | 2356 } // namespace net |
OLD | NEW |