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

Unified Diff: net/base/network_change_notifier.h

Issue 10837123: Add histograms to NetworkChangeNotifier to identify ways to improve interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address szym's comments and nits. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.h
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 03bcbf30f5da313788571823ca473f4c775a3f84..10c50642cc19d57d1ec58e3bb5b182309b29daaf 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -10,8 +10,11 @@
#include "base/synchronization/lock.h"
#include "net/base/net_export.h"
+class GURL;
+
namespace net {
+class HistogramWatcher;
class NetworkChangeNotifierFactory;
namespace internal {
@@ -177,6 +180,15 @@ class NET_EXPORT NetworkChangeNotifier {
NotifyObserversOfIPAddressChange();
}
+ // Let the NetworkChangeNotifier know we received some data.
+ // This is used strictly for producing histogram data about the accuracy of
+ // the NetworkChangenotifier's online detection.
+ static void NotifyDataReceived(const GURL& source);
+
+ // Register the Observer callbacks for producing histogram data. This
+ // should be called from the network thread to avoid race conditions.
+ static void InitHistogramWatcher();
+
protected:
friend class internal::DnsConfigWatcher;
@@ -230,6 +242,9 @@ class NET_EXPORT NetworkChangeNotifier {
base::Lock watching_dns_lock_;
bool watching_dns_;
+ // A little-piggy-back observer that simply logs UMA histogram data.
+ scoped_ptr<HistogramWatcher> histogram_watcher_;
+
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
};
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698