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

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

Issue 1411253008: WebRTC should generate default private address even when adapter enumeration is disabled. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: after rebase on master Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/stunport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stunport.h
diff --git a/webrtc/p2p/base/stunport.h b/webrtc/p2p/base/stunport.h
index 62b23cf074ba2084b9ce4b8cd4ca0553b2c6f635..6e7a239578f109b3bbbc4f3aa8b3bf62ce6aa0bd 100644
--- a/webrtc/p2p/base/stunport.h
+++ b/webrtc/p2p/base/stunport.h
@@ -35,10 +35,9 @@ class UDPPort : public Port {
const std::string& username,
const std::string& password,
const std::string& origin,
- bool emit_localhost_for_anyaddress) {
- UDPPort* port = new UDPPort(thread, factory, network, socket,
- username, password, origin,
- emit_localhost_for_anyaddress);
+ bool emit_local_for_anyaddress) {
+ UDPPort* port = new UDPPort(thread, factory, network, socket, username,
+ password, origin, emit_local_for_anyaddress);
if (!port->Init()) {
delete port;
port = NULL;
@@ -55,11 +54,10 @@ class UDPPort : public Port {
const std::string& username,
const std::string& password,
const std::string& origin,
- bool emit_localhost_for_anyaddress) {
- UDPPort* port = new UDPPort(thread, factory, network,
- ip, min_port, max_port,
- username, password, origin,
- emit_localhost_for_anyaddress);
+ bool emit_local_for_anyaddress) {
+ UDPPort* port =
+ new UDPPort(thread, factory, network, ip, min_port, max_port, username,
+ password, origin, emit_local_for_anyaddress);
if (!port->Init()) {
delete port;
port = NULL;
@@ -115,7 +113,7 @@ class UDPPort : public Port {
const std::string& username,
const std::string& password,
const std::string& origin,
- bool emit_localhost_for_anyaddress);
+ bool emit_local_for_anyaddress);
UDPPort(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
@@ -124,7 +122,7 @@ class UDPPort : public Port {
const std::string& username,
const std::string& password,
const std::string& origin,
- bool emit_localhost_for_anyaddress);
+ bool emit_local_for_anyaddress);
bool Init();
@@ -150,6 +148,10 @@ class UDPPort : public Port {
void SendStunBindingRequests();
+ // Helper function which will set |addr|'s IP to the default local address if
+ // |addr| is the "any" address and |emit_local_for_anyaddress_| is true.
+ void MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const;
+
private:
// A helper class which can be called repeatedly to resolve multiple
// addresses, as opposed to rtc::AsyncResolverInterface, which can only
@@ -211,8 +213,9 @@ class UDPPort : public Port {
bool ready_;
int stun_keepalive_delay_;
- // This is true when PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE is specified.
- bool emit_localhost_for_anyaddress_;
+ // This is true by default and false when
+ // PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE is specified.
+ bool emit_local_for_anyaddress_;
friend class StunBindingRequest;
};
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/stunport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698