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

Side by Side Diff: net/base/network_change_notifier_win.h

Issue 9147026: API for connection type (Ethernet/WIFI/WWAN ...) in NetworkChangeNotifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed a typo 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
« no previous file with comments | « net/base/network_change_notifier_mac.cc ('k') | net/base/network_change_notifier_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // For unit tests only. 45 // For unit tests only.
46 bool is_watching() { return is_watching_; } 46 bool is_watching() { return is_watching_; }
47 void set_is_watching(bool is_watching) { is_watching_ = is_watching; } 47 void set_is_watching(bool is_watching) { is_watching_ = is_watching; }
48 int sequential_failures() { return sequential_failures_; } 48 int sequential_failures() { return sequential_failures_; }
49 49
50 private: 50 private:
51 class DnsWatcherThread; 51 class DnsWatcherThread;
52 friend class NetworkChangeNotifierWinTest; 52 friend class NetworkChangeNotifierWinTest;
53 53
54 // NetworkChangeNotifier methods: 54 // NetworkChangeNotifier methods:
55 virtual bool IsCurrentlyOffline() const OVERRIDE; 55 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE;
56 56
57 // ObjectWatcher::Delegate methods: 57 // ObjectWatcher::Delegate methods:
58 // Must only be called on the thread |this| was created on. 58 // Must only be called on the thread |this| was created on.
59 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; 59 virtual void OnObjectSignaled(HANDLE object) OVERRIDE;
60 60
61 // Notifies IP address change observers of a change immediately, and notifies 61 // Notifies IP address change observers of a change immediately, and notifies
62 // network state change observers on a delay. Must only be called on the 62 // network state change observers on a delay. Must only be called on the
63 // thread |this| was created on. 63 // thread |this| was created on.
64 void NotifyObservers(); 64 void NotifyObservers();
65 65
66 // Forwards online state notifications to parent class. 66 // Forwards connection type notifications to parent class.
67 void NotifyParentOfOnlineStateChange(); 67 void NotifyParentOfConnectionTypeChange();
68 68
69 // Tries to start listening for a single subsequent address change. Returns 69 // Tries to start listening for a single subsequent address change. Returns
70 // false on failure. The caller is responsible for updating |is_watching_|. 70 // false on failure. The caller is responsible for updating |is_watching_|.
71 // Virtual for unit tests. Must only be called on the thread |this| was 71 // Virtual for unit tests. Must only be called on the thread |this| was
72 // created on. 72 // created on.
73 virtual bool WatchForAddressChangeInternal(); 73 virtual bool WatchForAddressChangeInternal();
74 74
75 // All member variables may only be accessed on the thread |this| was created 75 // All member variables may only be accessed on the thread |this| was created
76 // on. 76 // on.
77 77
(...skipping 15 matching lines...) Expand all
93 93
94 // Thread on which we can run DnsConfigWatcher. 94 // Thread on which we can run DnsConfigWatcher.
95 scoped_ptr<DnsWatcherThread> dns_watcher_thread_; 95 scoped_ptr<DnsWatcherThread> dns_watcher_thread_;
96 96
97 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); 97 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin);
98 }; 98 };
99 99
100 } // namespace net 100 } // namespace net
101 101
102 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_ 102 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_WIN_H_
OLDNEW
« no previous file with comments | « net/base/network_change_notifier_mac.cc ('k') | net/base/network_change_notifier_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698