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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 void BasicNetworkManager::StartNetworkMonitor() { | 754 void BasicNetworkManager::StartNetworkMonitor() { |
755 NetworkMonitorFactory* factory = NetworkMonitorFactory::GetFactory(); | 755 NetworkMonitorFactory* factory = NetworkMonitorFactory::GetFactory(); |
756 if (factory == nullptr) { | 756 if (factory == nullptr) { |
757 return; | 757 return; |
758 } | 758 } |
759 if (!network_monitor_) { | 759 if (!network_monitor_) { |
760 network_monitor_.reset(factory->CreateNetworkMonitor()); | 760 network_monitor_.reset(factory->CreateNetworkMonitor()); |
761 if (!network_monitor_) { | 761 if (!network_monitor_) { |
762 return; | 762 return; |
763 } | 763 } |
| 764 network_monitor_->SignalNetworksChanged.connect( |
| 765 this, &BasicNetworkManager::OnNetworksChanged); |
764 } | 766 } |
765 | |
766 network_monitor_->SignalNetworksChanged.connect( | |
767 this, &BasicNetworkManager::OnNetworksChanged); | |
768 network_monitor_->Start(); | 767 network_monitor_->Start(); |
769 } | 768 } |
770 | 769 |
771 void BasicNetworkManager::StopNetworkMonitor() { | 770 void BasicNetworkManager::StopNetworkMonitor() { |
772 if (!network_monitor_) { | 771 if (!network_monitor_) { |
773 return; | 772 return; |
774 } | 773 } |
775 network_monitor_->Stop(); | 774 network_monitor_->Stop(); |
776 } | 775 } |
777 | 776 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 std::stringstream ss; | 975 std::stringstream ss; |
977 // 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 |
978 // the IP address. | 977 // the IP address. |
979 ss << "Net[" << description_.substr(0, description_.find(' ')) | 978 ss << "Net[" << description_.substr(0, description_.find(' ')) |
980 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 979 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ |
981 << ":" << AdapterTypeToString(type_) << "]"; | 980 << ":" << AdapterTypeToString(type_) << "]"; |
982 return ss.str(); | 981 return ss.str(); |
983 } | 982 } |
984 | 983 |
985 } // namespace rtc | 984 } // namespace rtc |
OLD | NEW |