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

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

Issue 2377883003: First step in providing a UdpTransportChannel. (Closed)
Patch Set: Unit test: VirtualSocketServer, constructor and nits. Created 4 years, 1 month 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
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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 if (local_ip.family() == AF_INET && !remote_v6_only && IPIsAny(remote_ip)) { 1160 if (local_ip.family() == AF_INET && !remote_v6_only && IPIsAny(remote_ip)) {
1161 return true; 1161 return true;
1162 } 1162 }
1163 // Same check, backwards. 1163 // Same check, backwards.
1164 int local_v6_only = 0; 1164 int local_v6_only = 0;
1165 local->GetOption(Socket::OPT_IPV6_V6ONLY, &local_v6_only); 1165 local->GetOption(Socket::OPT_IPV6_V6ONLY, &local_v6_only);
1166 if (remote_ip.family() == AF_INET && !local_v6_only && IPIsAny(local_ip)) { 1166 if (remote_ip.family() == AF_INET && !local_v6_only && IPIsAny(local_ip)) {
1167 return true; 1167 return true;
1168 } 1168 }
1169 1169
1170 if (local->was_any()) {
1171 return true;
1172 }
1173 if (remote->was_any()) {
1174 return true;
1175 }
Taylor Brandstetter 2016/11/04 17:51:07 I don't think this is necessary, is it?
1170 // Check to see if either socket was explicitly bound to IPv6-any. 1176 // Check to see if either socket was explicitly bound to IPv6-any.
1171 // These sockets can talk with anyone. 1177 // These sockets can talk with anyone.
1172 if (local_ip.family() == AF_INET6 && local->was_any()) { 1178 if (local_ip.family() == AF_INET6 && local->was_any()) {
1173 return true; 1179 return true;
1174 } 1180 }
1175 if (remote_ip.family() == AF_INET6 && remote->was_any()) { 1181 if (remote_ip.family() == AF_INET6 && remote->was_any()) {
1176 return true; 1182 return true;
1177 } 1183 }
1178 1184
1179 return false; 1185 return false;
(...skipping 11 matching lines...) Expand all
1191 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) { 1197 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) {
1192 RTC_DCHECK(!IPIsAny(from_addr)); 1198 RTC_DCHECK(!IPIsAny(from_addr));
1193 if (from_addr.family() == AF_INET) { 1199 if (from_addr.family() == AF_INET) {
1194 default_route_v4_ = from_addr; 1200 default_route_v4_ = from_addr;
1195 } else if (from_addr.family() == AF_INET6) { 1201 } else if (from_addr.family() == AF_INET6) {
1196 default_route_v6_ = from_addr; 1202 default_route_v6_ = from_addr;
1197 } 1203 }
1198 } 1204 }
1199 1205
1200 } // namespace rtc 1206 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/BUILD.gn ('k') | webrtc/p2p/BUILD.gn » ('j') | webrtc/p2p/base/udptransportchannel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698