Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/host_resolver_impl.h" | 5 #include "net/base/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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 // Gets a list of the likely error codes that getaddrinfo() can return | 79 // Gets a list of the likely error codes that getaddrinfo() can return |
| 80 // (non-exhaustive). These are the error codes that we will track via | 80 // (non-exhaustive). These are the error codes that we will track via |
| 81 // a histogram. | 81 // a histogram. |
| 82 std::vector<int> GetAllGetAddrinfoOSErrors() { | 82 std::vector<int> GetAllGetAddrinfoOSErrors() { |
| 83 int os_errors[] = { | 83 int os_errors[] = { |
| 84 #if defined(OS_POSIX) | 84 #if defined(OS_POSIX) |
| 85 #if !defined(OS_FREEBSD) | 85 #if !defined(OS_FREEBSD) |
| 86 #if !defined(OS_ANDROID) | 86 #if !defined(OS_ANDROID) |
| 87 // EAI_ADDRFAMILY has been declared obsolete in Android's netdb.h. | 87 // EAI_ADDRFAMILY has been declared obsolete in Android's and |
| 88 // FreeBSD's netdb.h. | |
| 88 EAI_ADDRFAMILY, | 89 EAI_ADDRFAMILY, |
| 89 #endif | 90 #endif |
| 91 // EAI_NODATA has been declared obsolete in FreeBSD's netdb.h. | |
| 90 EAI_NODATA, | 92 EAI_NODATA, |
| 91 #endif | 93 #endif |
|
wtc
2011/11/30 01:08:15
It seems better to use independent ifdefs rather t
| |
| 92 EAI_AGAIN, | 94 EAI_AGAIN, |
| 93 EAI_BADFLAGS, | 95 EAI_BADFLAGS, |
| 94 EAI_FAIL, | 96 EAI_FAIL, |
| 95 EAI_FAMILY, | 97 EAI_FAMILY, |
| 96 EAI_MEMORY, | 98 EAI_MEMORY, |
| 97 EAI_NONAME, | 99 EAI_NONAME, |
| 98 EAI_SERVICE, | 100 EAI_SERVICE, |
| 99 EAI_SOCKTYPE, | 101 EAI_SOCKTYPE, |
| 100 EAI_SYSTEM, | 102 EAI_SYSTEM, |
| 101 #elif defined(OS_WIN) | 103 #elif defined(OS_WIN) |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1594 // resolv.conf changes so we don't need to do anything to clear that cache. | 1596 // resolv.conf changes so we don't need to do anything to clear that cache. |
| 1595 if (cache_.get()) | 1597 if (cache_.get()) |
| 1596 cache_->clear(); | 1598 cache_->clear(); |
| 1597 // Existing jobs will have been sent to the original server so they need to | 1599 // Existing jobs will have been sent to the original server so they need to |
| 1598 // be aborted. TODO(Craig): Should these jobs be restarted? | 1600 // be aborted. TODO(Craig): Should these jobs be restarted? |
| 1599 AbortAllInProgressJobs(); | 1601 AbortAllInProgressJobs(); |
| 1600 // |this| may be deleted inside AbortAllInProgressJobs(). | 1602 // |this| may be deleted inside AbortAllInProgressJobs(). |
| 1601 } | 1603 } |
| 1602 | 1604 |
| 1603 } // namespace net | 1605 } // namespace net |
| OLD | NEW |