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

Unified Diff: talk/app/webrtc/webrtcsession.cc

Issue 1328453003: Add more IceCandidatePairType for host-host CandidatePair (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/umametrics.h ('k') | talk/app/webrtc/webrtcsession_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/webrtcsession.cc
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index 9102e78eeac9affa903fc5c5f8c148c3d6f231c7..6a761e6ab95a75d80fec9c2dd741860a2f99d967 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -97,8 +97,23 @@ IceCandidatePairType GetIceCandidatePairCounter(
const auto& srflx = STUN_PORT_TYPE;
const auto& relay = RELAY_PORT_TYPE;
const auto& prflx = PRFLX_PORT_TYPE;
- if (l == host && r == host)
- return kIceCandidatePairHostHost;
+ if (l == host && r == host) {
+ bool local_private = IPIsPrivate(local.address().ipaddr());
+ bool remote_private = IPIsPrivate(remote.address().ipaddr());
+ if (local_private) {
+ if (remote_private) {
+ return kIceCandidatePairHostPrivateHostPrivate;
+ } else {
+ return kIceCandidatePairHostPrivateHostPublic;
+ }
+ } else {
+ if (remote_private) {
+ return kIceCandidatePairHostPublicHostPrivate;
+ } else {
+ return kIceCandidatePairHostPublicHostPublic;
+ }
+ }
+ }
if (l == host && r == srflx)
return kIceCandidatePairHostSrflx;
if (l == host && r == relay)
« no previous file with comments | « talk/app/webrtc/umametrics.h ('k') | talk/app/webrtc/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698