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

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

Issue 11270039: Add NetworkChangeNotifier connectivity events to the NetLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 1 month 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/base/net_log_event_type_list.h ('k') | net/base/network_change_notifier.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_H_ 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/observer_list_threadsafe.h" 9 #include "base/observer_list_threadsafe.h"
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // there's no reason to use the API in this risky way, so don't do it. 156 // there's no reason to use the API in this risky way, so don't do it.
157 static void RemoveIPAddressObserver(IPAddressObserver* observer); 157 static void RemoveIPAddressObserver(IPAddressObserver* observer);
158 static void RemoveConnectionTypeObserver(ConnectionTypeObserver* observer); 158 static void RemoveConnectionTypeObserver(ConnectionTypeObserver* observer);
159 static void RemoveDNSObserver(DNSObserver* observer); 159 static void RemoveDNSObserver(DNSObserver* observer);
160 160
161 // Allow unit tests to trigger notifications. 161 // Allow unit tests to trigger notifications.
162 static void NotifyObserversOfIPAddressChangeForTests() { 162 static void NotifyObserversOfIPAddressChangeForTests() {
163 NotifyObserversOfIPAddressChange(); 163 NotifyObserversOfIPAddressChange();
164 } 164 }
165 165
166 // Return a string equivalent to |type|.
167 static const char* ConnectionTypeToString(ConnectionType type);
168
166 // Let the NetworkChangeNotifier know we received some data. 169 // Let the NetworkChangeNotifier know we received some data.
167 // This is used strictly for producing histogram data about the accuracy of 170 // This is used strictly for producing histogram data about the accuracy of
168 // the NetworkChangenotifier's online detection. 171 // the NetworkChangenotifier's online detection.
169 static void NotifyDataReceived(const GURL& source); 172 static void NotifyDataReceived(const GURL& source);
170 173
171 // Register the Observer callbacks for producing histogram data. This 174 // Register the Observer callbacks for producing histogram data. This
172 // should be called from the network thread to avoid race conditions. 175 // should be called from the network thread to avoid race conditions.
173 static void InitHistogramWatcher(); 176 static void InitHistogramWatcher();
174 177
175 protected: 178 protected:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 232
230 // A little-piggy-back observer that simply logs UMA histogram data. 233 // A little-piggy-back observer that simply logs UMA histogram data.
231 scoped_ptr<HistogramWatcher> histogram_watcher_; 234 scoped_ptr<HistogramWatcher> histogram_watcher_;
232 235
233 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); 236 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
234 }; 237 };
235 238
236 } // namespace net 239 } // namespace net
237 240
238 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ 241 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698