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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 return false; | 720 return false; |
721 } | 721 } |
722 | 722 |
723 void BasicNetworkManager::StartUpdating() { | 723 void BasicNetworkManager::StartUpdating() { |
724 thread_ = Thread::Current(); | 724 thread_ = Thread::Current(); |
725 if (start_count_) { | 725 if (start_count_) { |
726 // If network interfaces are already discovered and signal is sent, | 726 // If network interfaces are already discovered and signal is sent, |
727 // we should trigger network signal immediately for the new clients | 727 // we should trigger network signal immediately for the new clients |
728 // to start allocating ports. | 728 // to start allocating ports. |
729 if (sent_first_update_) | 729 if (sent_first_update_) |
730 thread_->Post(this, kSignalNetworksMessage); | 730 thread_->Post(FROM_HERE, this, kSignalNetworksMessage); |
731 } else { | 731 } else { |
732 thread_->Post(this, kUpdateNetworksMessage); | 732 thread_->Post(FROM_HERE, this, kUpdateNetworksMessage); |
733 StartNetworkMonitor(); | 733 StartNetworkMonitor(); |
734 } | 734 } |
735 ++start_count_; | 735 ++start_count_; |
736 } | 736 } |
737 | 737 |
738 void BasicNetworkManager::StopUpdating() { | 738 void BasicNetworkManager::StopUpdating() { |
739 ASSERT(Thread::Current() == thread_); | 739 ASSERT(Thread::Current() == thread_); |
740 if (!start_count_) | 740 if (!start_count_) |
741 return; | 741 return; |
742 | 742 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 QueryDefaultLocalAddress(AF_INET6)); | 825 QueryDefaultLocalAddress(AF_INET6)); |
826 if (changed || !sent_first_update_) { | 826 if (changed || !sent_first_update_) { |
827 SignalNetworksChanged(); | 827 SignalNetworksChanged(); |
828 sent_first_update_ = true; | 828 sent_first_update_ = true; |
829 } | 829 } |
830 } | 830 } |
831 } | 831 } |
832 | 832 |
833 void BasicNetworkManager::UpdateNetworksContinually() { | 833 void BasicNetworkManager::UpdateNetworksContinually() { |
834 UpdateNetworksOnce(); | 834 UpdateNetworksOnce(); |
835 thread_->PostDelayed(kNetworksUpdateIntervalMs, this, kUpdateNetworksMessage); | 835 thread_->PostDelayed(FROM_HERE, kNetworksUpdateIntervalMs, this, |
| 836 kUpdateNetworksMessage); |
836 } | 837 } |
837 | 838 |
838 void BasicNetworkManager::DumpNetworks() { | 839 void BasicNetworkManager::DumpNetworks() { |
839 NetworkList list; | 840 NetworkList list; |
840 GetNetworks(&list); | 841 GetNetworks(&list); |
841 LOG(LS_INFO) << "NetworkManager detected " << list.size() << " networks:"; | 842 LOG(LS_INFO) << "NetworkManager detected " << list.size() << " networks:"; |
842 for (const Network* network : list) { | 843 for (const Network* network : list) { |
843 LOG(LS_INFO) << network->ToString() << ": " << network->description() | 844 LOG(LS_INFO) << network->ToString() << ": " << network->description() |
844 << ", active ? " << network->active() | 845 << ", active ? " << network->active() |
845 << ((network->ignored()) ? ", Ignored" : ""); | 846 << ((network->ignored()) ? ", Ignored" : ""); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 std::stringstream ss; | 939 std::stringstream ss; |
939 // Print out the first space-terminated token of the network desc, plus | 940 // Print out the first space-terminated token of the network desc, plus |
940 // the IP address. | 941 // the IP address. |
941 ss << "Net[" << description_.substr(0, description_.find(' ')) | 942 ss << "Net[" << description_.substr(0, description_.find(' ')) |
942 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 943 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ |
943 << ":" << AdapterTypeToString(type_) << "]"; | 944 << ":" << AdapterTypeToString(type_) << "]"; |
944 return ss.str(); | 945 return ss.str(); |
945 } | 946 } |
946 | 947 |
947 } // namespace rtc | 948 } // namespace rtc |
OLD | NEW |