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

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: 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
« net/base/net_log_event_type_list.h ('K') | « 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..08140701f7428c697c7489524f34c6f3ad361dcb 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) {
+ switch (type) {
+ case CONNECTION_UNKNOWN:
+ return "CONNECTION_UNKNOWN";
+ case CONNECTION_ETHERNET:
+ return "CONNECTION_ETHERNET";
+ case CONNECTION_WIFI:
+ return "CONNECTION_WIFI";
+ case CONNECTION_2G:
+ return "CONNECTION_2G";
+ case CONNECTION_3G:
+ return "CONNECTION_3G";
+ case CONNECTION_4G:
+ return "CONNECTION_4G";
+ case CONNECTION_NONE:
+ return "CONNECTION_NONE";
+ }
mmenke 2012/10/25 16:25:31 To avoid regressions, I suggest putting these in a
pauljensen 2012/10/25 17:08:15 I copied the method of NetLog::EventPhaseToString(
mmenke 2012/10/25 17:34:57 Rsleevi's method is nifty, too. EventPhaseToStrin
+ NOTREACHED();
+ return NULL;
+}
+
+// static
void NetworkChangeNotifier::NotifyDataReceived(const GURL& source) {
if (!g_network_change_notifier)
return;
« net/base/net_log_event_type_list.h ('K') | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698