OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This file supports network stack independent notification of progress | |
6 // towards resolving a hostname. | |
7 | |
8 // The observer class supports exactly one active (Add'ed) instance, and in | |
9 // typical usage, that observer will be Add'ed during process startup, and | |
10 // Remove'd during process termination. | |
11 | |
12 | |
13 #ifndef NET_BASE_DNS_RESOLUTION_OBSERVER_H_ | |
14 #define NET_BASE_DNS_RESOLUTION_OBSERVER_H_ | |
15 | |
16 #include <string> | |
17 | |
18 #include "net/base/host_resolver.h" | |
19 | |
20 class GURL; | |
21 | |
22 namespace net { | |
23 | |
24 // TODO(eroman): Move this interface to HostResolver::Observer. | |
25 class DnsResolutionObserver { | |
26 public: | |
27 virtual ~DnsResolutionObserver() {} | |
28 | |
29 // For each OnStartResolution() notification, there should be a later | |
30 // OnFinishResolutionWithStatus() indicating completion of the resolution | |
31 // activity. | |
32 // Related pairs of notification will arrive with matching id values. | |
33 // A caller may use the id values to match up these asynchronous calls | |
34 // from among a larger call stream. | |
35 virtual void OnStartResolution(int id, | |
36 const HostResolver::RequestInfo& info) = 0; | |
37 virtual void OnFinishResolutionWithStatus( | |
38 int id, | |
39 bool was_resolved, | |
40 const HostResolver::RequestInfo& info) = 0; | |
41 }; | |
42 | |
43 } // namspace net | |
44 | |
45 #endif // NET_BASE_DNS_RESOLUTION_OBSERVER_H_ | |
OLD | NEW |