Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: net/dns/dns_config_watcher.h

Issue 10377092: [net/dns] Isolate DnsConfigWatcher from DnsConfigService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added sanity DCHECK. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/dns_config_watcher_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_DNS_DNS_CONFIG_WATCHER_H_
6 #define NET_DNS_DNS_CONFIG_WATCHER_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace net {
13 namespace internal {
14
15 // Watches when the system DNS settings have changed. It is used by
16 // NetworkChangeNotifier to provide signals to registered DNSObservers.
17 // Depending on the platform, watches files, Windows registry, or libnotify key.
18 // If some watches fail, we keep the working parts, but NetworkChangeNotifier
19 // will mark notifications to DNSObserver with the CHANGE_DNS_WATCH_FAILED bit.
20 class DnsConfigWatcher {
21 public:
22 DnsConfigWatcher();
23 ~DnsConfigWatcher();
24
25 // Starts watching system configuration for changes. The current thread must
26 // have a MessageLoopForIO. The signals will be delivered directly to
27 // the global NetworkChangeNotifier.
28 void Init();
29
30 // Must be called on the same thread as Init. Required if dtor will be called
31 // on a different thread.
32 void CleanUp();
33
34 private:
35 // Platform-specific implementation.
36 class Core;
37 scoped_ptr<Core> core_;
38
39 DISALLOW_COPY_AND_ASSIGN(DnsConfigWatcher);
40 };
41
42 } // namespace internal
43 } // namespace net
44
45 #endif // NET_DNS_DNS_CONFIG_WATCHER_H_
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/dns_config_watcher_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698