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

Side by Side Diff: webrtc/base/network.cc

Issue 1592763003: fix bug 5430 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/network_unittest.cc » ('j') | webrtc/base/network_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 ASSERT(thread_ == Thread::Current()); 767 ASSERT(thread_ == Thread::Current());
768 ASSERT(thread_->socketserver() != nullptr); 768 ASSERT(thread_->socketserver() != nullptr);
769 ASSERT(family == AF_INET || family == AF_INET6); 769 ASSERT(family == AF_INET || family == AF_INET6);
770 770
771 scoped_ptr<AsyncSocket> socket( 771 scoped_ptr<AsyncSocket> socket(
772 thread_->socketserver()->CreateAsyncSocket(family, SOCK_DGRAM)); 772 thread_->socketserver()->CreateAsyncSocket(family, SOCK_DGRAM));
773 if (!socket) { 773 if (!socket) {
774 return IPAddress(); 774 return IPAddress();
775 } 775 }
776 776
777 if (!socket->Connect( 777 if (socket->Connect(SocketAddress(
778 SocketAddress(family == AF_INET ? kPublicIPv4Host : kPublicIPv6Host, 778 family == AF_INET ? kPublicIPv4Host : kPublicIPv6Host, kPublicPort)) <
779 kPublicPort))) { 779 0) {
780 return IPAddress(); 780 return IPAddress();
781 } 781 }
782 return socket->GetLocalAddress().ipaddr(); 782 return socket->GetLocalAddress().ipaddr();
783 } 783 }
784 784
785 void BasicNetworkManager::UpdateNetworksOnce() { 785 void BasicNetworkManager::UpdateNetworksOnce() {
786 if (!start_count_) 786 if (!start_count_)
787 return; 787 return;
788 788
789 ASSERT(Thread::Current() == thread_); 789 ASSERT(Thread::Current() == thread_);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 std::stringstream ss; 912 std::stringstream ss;
913 // Print out the first space-terminated token of the network desc, plus 913 // Print out the first space-terminated token of the network desc, plus
914 // the IP address. 914 // the IP address.
915 ss << "Net[" << description_.substr(0, description_.find(' ')) 915 ss << "Net[" << description_.substr(0, description_.find(' '))
916 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ 916 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_
917 << ":" << AdapterTypeToString(type_) << "]"; 917 << ":" << AdapterTypeToString(type_) << "]";
918 return ss.str(); 918 return ss.str();
919 } 919 }
920 920
921 } // namespace rtc 921 } // namespace rtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/network_unittest.cc » ('j') | webrtc/base/network_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698