| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file supports network stack independent notification of progress | 5 // This file supports network stack independent notification of progress |
| 6 // towards resolving a hostname. | 6 // towards resolving a hostname. |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include "net/base/dns_resolution_observer.h" |
| 9 |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "net/base/dns_resolution_observer.h" | |
| 12 | |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 | 13 |
| 15 namespace net { | 14 namespace net { |
| 16 | 15 |
| 17 static DnsResolutionObserver* dns_resolution_observer; | 16 static DnsResolutionObserver* dns_resolution_observer; |
| 18 | 17 |
| 19 void AddDnsResolutionObserver(DnsResolutionObserver* new_observer) { | 18 void AddDnsResolutionObserver(DnsResolutionObserver* new_observer) { |
| 20 if (new_observer == dns_resolution_observer) | 19 if (new_observer == dns_resolution_observer) |
| 21 return; // Facilitate unit tests that init/teardown repeatedly. | 20 return; // Facilitate unit tests that init/teardown repeatedly. |
| 22 DCHECK(!dns_resolution_observer); | 21 DCHECK(!dns_resolution_observer); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 | 49 |
| 51 void DidFinishDnsResolutionWithStatus(bool was_resolved, void* context) { | 50 void DidFinishDnsResolutionWithStatus(bool was_resolved, void* context) { |
| 52 DnsResolutionObserver* current_observer = dns_resolution_observer; | 51 DnsResolutionObserver* current_observer = dns_resolution_observer; |
| 53 if (current_observer) { | 52 if (current_observer) { |
| 54 current_observer->OnFinishResolutionWithStatus(was_resolved, context); | 53 current_observer->OnFinishResolutionWithStatus(was_resolved, context); |
| 55 } | 54 } |
| 56 } | 55 } |
| 57 | 56 |
| 58 } // namspace net | 57 } // namspace net |
| 59 | 58 |
| OLD | NEW |