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

Unified Diff: webrtc/p2p/base/stunport.cc

Issue 2989303002: Make Port (and subclasses) fully "Network"-based, instead of IP-based. (Closed)
Patch Set: Add back Port constructor that takes IP for backwards compatibility. Created 3 years, 4 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 | « webrtc/p2p/base/stunport.h ('k') | webrtc/p2p/base/stunport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stunport.cc
diff --git a/webrtc/p2p/base/stunport.cc b/webrtc/p2p/base/stunport.cc
index fa7a63c46b720367fa530267ba5eccb91e89dd63..5f6889e6dc23618d6bf9dbbb033793c67a276a2d 100644
--- a/webrtc/p2p/base/stunport.cc
+++ b/webrtc/p2p/base/stunport.cc
@@ -170,7 +170,6 @@ UDPPort::UDPPort(rtc::Thread* thread,
LOCAL_PORT_TYPE,
factory,
network,
- socket->GetLocalAddress().ipaddr(),
username,
password),
requests_(thread),
@@ -185,7 +184,6 @@ UDPPort::UDPPort(rtc::Thread* thread,
UDPPort::UDPPort(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
rtc::Network* network,
- const rtc::IPAddress& ip,
uint16_t min_port,
uint16_t max_port,
const std::string& username,
@@ -196,7 +194,6 @@ UDPPort::UDPPort(rtc::Thread* thread,
LOCAL_PORT_TYPE,
factory,
network,
- ip,
min_port,
max_port,
username,
@@ -215,7 +212,7 @@ bool UDPPort::Init() {
if (!SharedSocket()) {
RTC_DCHECK(socket_ == NULL);
socket_ = socket_factory()->CreateUdpSocket(
- rtc::SocketAddress(ip(), 0), min_port(), max_port());
+ rtc::SocketAddress(Network()->GetBestIP(), 0), min_port(), max_port());
if (!socket_) {
LOG_J(LS_WARNING, this) << "UDP socket creation failed";
return false;
@@ -379,8 +376,8 @@ void UDPPort::OnResolveResult(const rtc::SocketAddress& input,
RTC_DCHECK(resolver_.get() != NULL);
rtc::SocketAddress resolved;
- if (error != 0 ||
- !resolver_->GetResolvedAddress(input, ip().family(), &resolved)) {
+ if (error != 0 || !resolver_->GetResolvedAddress(
+ input, Network()->GetBestIP().family(), &resolved)) {
LOG_J(LS_WARNING, this) << "StunPort: stun host lookup received error "
<< error;
OnStunBindingOrResolveRequestFailed(input);
« no previous file with comments | « webrtc/p2p/base/stunport.h ('k') | webrtc/p2p/base/stunport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698