Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license | 
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source | 
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found | 
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may | 
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. | 
| 9 */ | 9 */ | 
| 10 | 10 | 
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 AdapterType type = network_monitor_->GetAdapterType(network_name); | 798 AdapterType type = network_monitor_->GetAdapterType(network_name); | 
| 799 if (type != ADAPTER_TYPE_UNKNOWN) { | 799 if (type != ADAPTER_TYPE_UNKNOWN) { | 
| 800 return type; | 800 return type; | 
| 801 } | 801 } | 
| 802 } | 802 } | 
| 803 #if defined(WEBRTC_IOS) | 803 #if defined(WEBRTC_IOS) | 
| 804 // Cell networks are pdp_ipN on iOS. | 804 // Cell networks are pdp_ipN on iOS. | 
| 805 if (strncmp(network_name, "pdp_ip", 6) == 0) { | 805 if (strncmp(network_name, "pdp_ip", 6) == 0) { | 
| 806 return ADAPTER_TYPE_CELLULAR; | 806 return ADAPTER_TYPE_CELLULAR; | 
| 807 } | 807 } | 
| 808 if (strncmp(network_name, "en", 2) == 0) { | |
| 809 // This may not be most accurate because sometimes Ethernet interface | |
| 810 // name also starts with "en" but it is better than showing it as | |
| 811 // "unknown" type. | |
| 
 
pthatcher1
2016/05/26 21:44:14
// TODO(honghaiz): Write a proper iOS NetworkManag
 
honghaiz3
2016/05/27 01:03:58
Done.
 
 | |
| 812 return ADAPTER_TYPE_WIFI; | |
| 813 } | |
| 808 #elif defined(WEBRTC_ANDROID) | 814 #elif defined(WEBRTC_ANDROID) | 
| 809 if (strncmp(network_name, "rmnet", 5) == 0 || | 815 if (strncmp(network_name, "rmnet", 5) == 0 || | 
| 810 strncmp(network_name, "v4-rmnet", 8) == 0) { | 816 strncmp(network_name, "v4-rmnet", 8) == 0) { | 
| 811 return ADAPTER_TYPE_CELLULAR; | 817 return ADAPTER_TYPE_CELLULAR; | 
| 812 } | 818 } | 
| 813 if (strncmp(network_name, "wlan", 4) == 0) { | 819 if (strncmp(network_name, "wlan", 4) == 0) { | 
| 814 return ADAPTER_TYPE_WIFI; | 820 return ADAPTER_TYPE_WIFI; | 
| 815 } | 821 } | 
| 816 #endif | 822 #endif | 
| 817 | 823 | 
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 std::stringstream ss; | 975 std::stringstream ss; | 
| 970 // Print out the first space-terminated token of the network desc, plus | 976 // Print out the first space-terminated token of the network desc, plus | 
| 971 // the IP address. | 977 // the IP address. | 
| 972 ss << "Net[" << description_.substr(0, description_.find(' ')) | 978 ss << "Net[" << description_.substr(0, description_.find(' ')) | 
| 973 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 979 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 
| 974 << ":" << AdapterTypeToString(type_) << "]"; | 980 << ":" << AdapterTypeToString(type_) << "]"; | 
| 975 return ss.str(); | 981 return ss.str(); | 
| 976 } | 982 } | 
| 977 | 983 | 
| 978 } // namespace rtc | 984 } // namespace rtc | 
| OLD | NEW |