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

Unified Diff: net/base/network_change_notifier.cc

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, 2 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 | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 6b87a3a95cd9e18ec9d15743c3fc4206f626fa1d..ab3fd43849fc8a278392db2eacee73213bf946ee 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -252,6 +252,29 @@ void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) {
}
// static
+const char* NetworkChangeNotifier::ConnectionTypeToString(
+ ConnectionType type) {
+ static const char* kConnectionTypeNames[] = {
+ "CONNECTION_UNKNOWN",
+ "CONNECTION_ETHERNET",
+ "CONNECTION_WIFI",
+ "CONNECTION_2G",
+ "CONNECTION_3G",
+ "CONNECTION_4G",
+ "CONNECTION_NONE"
+ };
+ COMPILE_ASSERT(
+ arraysize(kConnectionTypeNames) ==
+ NetworkChangeNotifier::CONNECTION_NONE + 1,
+ ConnectionType_name_count_mismatch);
+ if (type < CONNECTION_UNKNOWN || type > CONNECTION_NONE) {
+ NOTREACHED();
+ return "CONNECTION_INVALID";
+ }
+ return kConnectionTypeNames[type];
+}
+
+// static
void NetworkChangeNotifier::NotifyDataReceived(const GURL& source) {
if (!g_network_change_notifier)
return;
« no previous file with comments | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698