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

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

Issue 1288843003: Revert "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 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 32d7355c0916d9c7dc0358b22f92f503fd2e9bdd..953e5854447b05c8249ae1d356aa0ee818689509 100644
--- a/webrtc/p2p/base/stunport.cc
+++ b/webrtc/p2p/base/stunport.cc
@@ -15,7 +15,6 @@
#include "webrtc/p2p/base/stun.h"
#include "webrtc/base/common.h"
#include "webrtc/base/helpers.h"
-#include "webrtc/base/ipaddress.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/nethelpers.h"
@@ -165,16 +164,14 @@ UDPPort::UDPPort(rtc::Thread* thread,
rtc::AsyncPacketSocket* socket,
const std::string& username,
const std::string& password,
- const std::string& origin,
- bool emit_localhost_for_anyaddress)
+ const std::string& origin)
: Port(thread, factory, network, socket->GetLocalAddress().ipaddr(),
username, password),
requests_(thread),
socket_(socket),
error_(0),
ready_(false),
- stun_keepalive_delay_(KEEPALIVE_DELAY),
- emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) {
+ stun_keepalive_delay_(KEEPALIVE_DELAY) {
requests_.set_origin(origin);
}
@@ -186,16 +183,14 @@ UDPPort::UDPPort(rtc::Thread* thread,
uint16 max_port,
const std::string& username,
const std::string& password,
- const std::string& origin,
- bool emit_localhost_for_anyaddress)
+ const std::string& origin)
: Port(thread, LOCAL_PORT_TYPE, factory, network, ip, min_port, max_port,
username, password),
requests_(thread),
socket_(NULL),
error_(0),
ready_(false),
- stun_keepalive_delay_(KEEPALIVE_DELAY),
- emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) {
+ stun_keepalive_delay_(KEEPALIVE_DELAY) {
requests_.set_origin(origin);
}
@@ -285,17 +280,9 @@ int UDPPort::GetError() {
void UDPPort::OnLocalAddressReady(rtc::AsyncPacketSocket* socket,
const rtc::SocketAddress& address) {
- // When adapter enumeration is disabled and binding to the any address, the
- // loopback address will be issued as a candidate instead if
- // |emit_localhost_for_anyaddress| is true. This is to allow connectivity on
- // demo pages without STUN/TURN to work.
- rtc::SocketAddress addr = address;
- if (addr.IsAnyIP() && emit_localhost_for_anyaddress_) {
- addr.SetIP(rtc::GetLoopbackIP(addr.family()));
- }
-
- AddAddress(addr, addr, rtc::SocketAddress(), UDP_PROTOCOL_NAME, "",
- LOCAL_PORT_TYPE, ICE_TYPE_PREFERENCE_HOST, 0, false);
+ AddAddress(address, address, rtc::SocketAddress(),
+ UDP_PROTOCOL_NAME, "", LOCAL_PORT_TYPE,
+ ICE_TYPE_PREFERENCE_HOST, 0, false);
MaybePrepareStunCandidate();
}
« 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