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/dnsrr_resolver.h" | 5 #include "net/base/dnsrr_resolver.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <netinet/in.h> | |
| 8 #include <resolv.h> | 9 #include <resolv.h> |
| 9 #endif | 10 #endif |
| 10 | 11 |
| 11 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 12 #include <windns.h> | 13 #include <windns.h> |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 #include "base/location.h" | 16 #include "base/location.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 // Runs on a worker thread. | 181 // Runs on a worker thread. |
| 181 | 182 |
| 182 if (HandleTestCases()) { | 183 if (HandleTestCases()) { |
| 183 Finish(); | 184 Finish(); |
| 184 return; | 185 return; |
| 185 } | 186 } |
| 186 | 187 |
| 187 bool r = true; | 188 bool r = true; |
| 188 #if defined(OS_MACOSX) || defined(OS_OPENBSD) | 189 #if defined(OS_MACOSX) || defined(OS_OPENBSD) |
| 189 if ((_res.options & RES_INIT) == 0) { | 190 if ((_res.options & RES_INIT) == 0) { |
| 191 #if defined(OS_OPENBSD) | |
| 192 if (res_init() != 0) | |
| 193 #else | |
| 190 if (res_ninit(&_res) != 0) | 194 if (res_ninit(&_res) != 0) |
|
wtc
2011/10/20 14:01:46
Hmm... If res_ninit(&_res) is equivalent to res_in
Robert Nagy
2011/10/20 17:44:44
THere might be differences so I would rather stay
| |
| 195 #endif | |
| 191 r = false; | 196 r = false; |
| 192 } | 197 } |
| 193 #else | 198 #else |
| 194 DnsReloaderMaybeReload(); | 199 DnsReloaderMaybeReload(); |
| 195 #endif | 200 #endif |
| 196 | 201 |
| 197 if (r) { | 202 if (r) { |
| 198 unsigned long saved_options = _res.options; | 203 unsigned long saved_options = _res.options; |
| 199 r = Do(); | 204 r = Do(); |
| 200 _res.options = saved_options; | 205 _res.options = saved_options; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 667 inflight_.erase(j); | 672 inflight_.erase(j); |
| 668 | 673 |
| 669 job->HandleResult(result, response); | 674 job->HandleResult(result, response); |
| 670 delete job; | 675 delete job; |
| 671 } | 676 } |
| 672 | 677 |
| 673 } // namespace net | 678 } // namespace net |
| 674 | 679 |
| 675 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::RRResolverHandle); | 680 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::RRResolverHandle); |
| 676 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::RRResolverWorker); | 681 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::RRResolverWorker); |
| OLD | NEW |