44 Commits

Author SHA1 Message Date
kwiberg
3ec4679dd2 Replace scoped_ptr with unique_ptr in webrtc/p2p/
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1923163003

Cr-Commit-Position: refs/heads/master@{#12532}
2016-04-27 14:22:58 +00:00
kjellander
f475277547 Rename constants files in webrtc/{media,p2p}
Multiple sources with the same names forces ugly GYP hacks in
Chromium's libjingle.gyp. Rename the sources in WebRTC to
enable cleaning this up in Chromium.

To summarize:
webrtc/media/base/constants.{cc,h} -> mediaconstants.{cc,h}
webrtc/p2p/base/constants.{cc,h} -> p2pconstants.{cc,h}

This CL will require coordinating landing a roll in Chromium.

BUG=webrtc:4256
NOTRY=True

Review URL: https://codereview.webrtc.org/1750593002

Cr-Commit-Position: refs/heads/master@{#11842}
2016-03-02 13:42:35 +00:00
Taylor Brandstetter
0c7e9f540b Removing webrtc::PortAllocatorFactoryInterface.
ICE servers are now passed directly into PortAllocator,
making PortAllocatorFactoryInterface redundant. This CL also
moves SetNetworkIgnoreMask to PortAllocator.

R=phoglund@webrtc.org, pthatcher@webrtc.org, tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1520963002 .

Cr-Commit-Position: refs/heads/master@{#11139}
2015-12-29 22:15:02 +00:00
guoweis
255d6f6fb2 Test case for CL 1437933002.
This is to make sure that we don't have any assert failure when running with adapter enumeration disabled and we have no IPv6 default local address.

BUG=webrtc:5061

Review URL: https://codereview.webrtc.org/1456663002

Cr-Commit-Position: refs/heads/master@{#10759}
2015-11-23 22:12:44 +00:00
deadbeef
653b8e02f2 Reland of Adding the ability to change ICE servers through SetConfiguration. (patchset #1 id:1 of https://codereview.webrtc.org/1424803004/ )
Reason for revert:
Relanding with compile warning fixed.

Original issue's description:
> Revert of Adding the ability to change ICE servers through SetConfiguration. (patchset #7 id:120001 of https://codereview.webrtc.org/1391013007/ )
>
> Reason for revert:
> Caused compiler warning, breaking Chrome FYI bots.
>
> Original issue's description:
> > Adding the ability to change ICE servers through SetConfiguration.
> >
> > Added a SetIceServers method to PortAllocator. Also added a new
> > PeerConnection Initialize method that takes a PortAllocator, in the
> > hope that we can get rid of PortAllocatorFactoryInterface, since the
> > only substantial thing a factory does is convert the webrtc:: ICE
> > servers to cricket:: versions.
> >
> > Committed: https://crrev.com/d3b26d94399ff539db375a9b84010ee75479d4cf
> > Cr-Commit-Position: refs/heads/master@{#10420}
>
> TBR=pthatcher@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://crrev.com/18a944bf0ac9eed872dc009bd58e6bc12c946303
> Cr-Commit-Position: refs/heads/master@{#10421}

TBR=pthatcher@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.webrtc.org/1414313003

Cr-Commit-Position: refs/heads/master@{#10609}
2015-11-11 20:55:18 +00:00
Guo-wei Shieh
9af97f8910 WebRTC should generate default private address even when adapter enumeration is disabled.
Introduce a DefaultAddressProvider such that rtc::Network can't access other part of NetworkManager.

This also removes the hack of generating the loopback address. The dependency has been removed by https://codereview.chromium.org/1417023003/

BUG=webrtc:5061
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1411253008 .

Cr-Commit-Position: refs/heads/master@{#10590}
2015-11-10 22:47:49 +00:00
deadbeef
18a944bf0a Revert of Adding the ability to change ICE servers through SetConfiguration. (patchset #7 id:120001 of https://codereview.webrtc.org/1391013007/ )
Reason for revert:
Caused compiler warning, breaking Chrome FYI bots.

Original issue's description:
> Adding the ability to change ICE servers through SetConfiguration.
>
> Added a SetIceServers method to PortAllocator. Also added a new
> PeerConnection Initialize method that takes a PortAllocator, in the
> hope that we can get rid of PortAllocatorFactoryInterface, since the
> only substantial thing a factory does is convert the webrtc:: ICE
> servers to cricket:: versions.
>
> Committed: https://crrev.com/d3b26d94399ff539db375a9b84010ee75479d4cf
> Cr-Commit-Position: refs/heads/master@{#10420}

TBR=pthatcher@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.webrtc.org/1424803004

Cr-Commit-Position: refs/heads/master@{#10421}
2015-10-27 02:21:45 +00:00
deadbeef
d3b26d9439 Adding the ability to change ICE servers through SetConfiguration.
Added a SetIceServers method to PortAllocator. Also added a new
PeerConnection Initialize method that takes a PortAllocator, in the
hope that we can get rid of PortAllocatorFactoryInterface, since the
only substantial thing a factory does is convert the webrtc:: ICE
servers to cricket:: versions.

Review URL: https://codereview.webrtc.org/1391013007

Cr-Commit-Position: refs/heads/master@{#10420}
2015-10-27 00:55:27 +00:00
Peter Boström
0c4e06b4c6 Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.

BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1362503003 .

Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 10:23:32 +00:00
Guo-wei Shieh
898d21c1d4 WebRTC might leak srflx ip address when multiple_routes disabled and IceTransportType is relay.
This change filters out local ports when CF_HOST is not originally specified to prevent these ports from sending out STUN which leaks IP address.

BUG=webrtc:4946
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1378753003 .

Cr-Commit-Position: refs/heads/master@{#10121}
2015-09-30 17:55:05 +00:00
honghaiz
98db68fdaa If gather_continually is set to true, keep the last port allocator session running while stopping all existing process of getting ports (when p2ptransportchannel first becomes writable).
BUG=5034

Review URL: https://codereview.webrtc.org/1359363003

Cr-Commit-Position: refs/heads/master@{#10110}
2015-09-29 14:58:26 +00:00
honghaiz
8c404fab8d When doing DisableEquivalentPhases, exclude those AllocationSequences
whose network has ever been removed. It is unlikely the sockets/ports/candidates created from
those AllocationSequences will still be valid.

BUG=

Review URL: https://codereview.webrtc.org/1361183004

Cr-Commit-Position: refs/heads/master@{#10093}
2015-09-28 14:59:50 +00:00
Peter Thatcher
7cbd188c5e Remove GICE (again).
R=guoweis@webrtc.org

Review URL: https://codereview.webrtc.org/1353713002 .

Cr-Commit-Position: refs/heads/master@{#9979}
2015-09-18 01:55:03 +00:00
guoweis
d12140a68e Revert change which removes GICE.
There are still dependencies on this functionality.

TBR=pthatcher@webrtc.org

BUG=526399

Review URL: https://codereview.webrtc.org/1336553003

Cr-Commit-Position: refs/heads/master@{#9920}
2015-09-10 20:32:21 +00:00
Peter Thatcher
d415629de7 Remove AsyncHttpRequest, AutoPortAllocator, ConnectivityChecker, and HttpPortAllocator.
BUG=webrtc:4149, webrtc:4456
R=deadbeef@webrtc.org, pbos@webrtc.org

Review URL: https://codereview.webrtc.org/1311353011 .

Cr-Commit-Position: refs/heads/master@{#9857}
2015-09-04 11:21:14 +00:00
Guo-wei Shieh
13d35f6ffc Add check to prevent TURN usage if the protocol is not allowed.
There are 2 ways to design this.

1. TCP Only mode: this means that we disable all UDP protocols across board.
2. disallow TURN over UDP. Along with DISABLE_UDP, DISABLE_STUN, we should achieve the same result.

I'm going with #2.

BUG=webrtc:4784
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1311153003 .

Cr-Commit-Position: refs/heads/master@{#9791}
2015-08-26 22:33:03 +00:00
Peter Thatcher
2159b89fa2 Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.
This reverts commit 5bdafd44c86ee46bd7e040f19828324583418b33.

Original CL: https://codereview.webrtc.org/1263663002/

R=guoweis@webrtc.org

Review URL: https://codereview.webrtc.org/1303393002 .

Cr-Commit-Position: refs/heads/master@{#9761}
2015-08-22 03:46:18 +00:00
guoweis
ea1012b2a4 address comments from https://codereview.webrtc.org/1277263002/
TBR=juberti@webrtc.org,pthather@webrtc.org

Review URL: https://codereview.webrtc.org/1305113002

Cr-Commit-Position: refs/heads/master@{#9757}
2015-08-21 16:06:37 +00:00
minyuel
5bdafd44c8 Revert "Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.""
This reverts commit 081f34b564e1a26ffbbe9515eba1fef7c736fdde.

Original code review see
https://codereview.webrtc.org/1291363005

The revert is due to a suspicion of "Reland "Remove GICE..." being the cause of failure on Linux memcheck, see
https://build.chromium.org/p/client.webrtc/builders/Linux%20Memcheck/builds/4137

TBR=pthatcher@webrtc.org,

BUG=

Review URL: https://codereview.webrtc.org/1308753003 .

Cr-Commit-Position: refs/heads/master@{#9756}
2015-08-21 13:52:58 +00:00
Guo-wei Shieh
fe3bc9d5ae Relanding "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied."
Migrated from https://codereview.webrtc.org/1275703006/ which causes test failures for android. On android, loopback interface was used as local interface to generate candidates. Add a test case to make sure this won't be broken in the future.

Also observed some failures under content_browsertests in chromium.fyi bot but can't repro locally. Might just be temporary test issue.

BUG=webrtc:4517
TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1299333003 .

Cr-Commit-Position: refs/heads/master@{#9746}
2015-08-20 15:48:27 +00:00
Peter Thatcher
081f34b564 Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots."
This reverts commit 475243a134be003aab30bb17294ca6c664d0ef81.

R=guoweis@webrtc.org

Review URL: https://codereview.webrtc.org/1291363005 .

Cr-Commit-Position: refs/heads/master@{#9738}
2015-08-20 03:37:59 +00:00
Guo-wei Shieh
47872ec90c In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate.
Adapter enumeration disable should be a concept from Network. Network will be hooked up with media permission (mic/camera) to check whether gathering local address is allowed.

BUG=crbug.com/520101
R=juberti@webrtc.org, pthatcher@webrtc.org

Committed: ba9ab4cd8d

Review URL: https://codereview.webrtc.org/1284113003 .

Cr-Commit-Position: refs/heads/master@{#9735}
2015-08-19 17:32:51 +00:00
Guo-wei Shieh
370c8848ad Revert "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied."
This reverts commit 0a2955f227666efd87b2a303a69c083ef801c528.

Revert "In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate."

This reverts commit ba9ab4cd8d2e8fbc068dc36b5e6f6331d7deeccf.

TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1288843003 .

Cr-Commit-Position: refs/heads/master@{#9729}
2015-08-19 00:00:21 +00:00
Guo-wei Shieh
ba9ab4cd8d In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate.
Adapter enumeration disable should be a concept from Network. Network will be hooked up with media permission (mic/camera) to check whether gathering local address is allowed.

BUG=crbug.com/520101
R=juberti@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1284113003 .

Cr-Commit-Position: refs/heads/master@{#9728}
2015-08-18 22:54:20 +00:00
Guo-wei Shieh
0a2955f227 Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied.
BUG=webrtc:4517
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1275703006 .

Cr-Commit-Position: refs/heads/master@{#9726}
2015-08-18 20:05:29 +00:00
Guo-wei Shieh
1147702958 WebRTC Bug 4865
Bug 4865: even without STUN/TURN, as long as the peer is on the open internet, the connectivity should work. This is actually a regression even for hangouts.

We need to issue the 0.0.0.0 candidate into Port::candidates_ and filter it out later. The reason is that when we create connection, we need a local candidate to match the remote candidate.

The same connection later will be updated with the prflx local candidate once the STUN ping response is received.

BUG=webrtc:4865
R=juberti@webrtc.org

Committed: 38f8893235

Review URL: https://codereview.webrtc.org/1274013002 .

Cr-Commit-Position: refs/heads/master@{#9717}
2015-08-15 16:28:46 +00:00
Guo-wei Shieh
38f8893235 WebRTC Bug 4865
Bug 4865: even without STUN/TURN, as long as the peer is on the open internet, the connectivity should work. This is actually a regression even for hangouts.

We need to issue the 0.0.0.0 candidate into Port::candidates_ and filter it out later. The reason is that when we create connection, we need a local candidate to match the remote candidate.

The same connection later will be updated with the prflx local candidate once the STUN ping response is received.

BUG=webrtc:4865
R=juberti@webrtc.org

Review URL: https://codereview.webrtc.org/1274013002 .

Cr-Commit-Position: refs/heads/master@{#9708}
2015-08-14 05:24:12 +00:00
pthatcher
fa301809b6 Revert "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.
This reverts commit 3449faa553ec94c52ef2d0949867befb60992c88.

TBR=deadbeef@webrtc.org, juberti@webrtc.org
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1274273005

Cr-Commit-Position: refs/heads/master@{#9698}
2015-08-11 11:13:00 +00:00
Peter Thatcher
3449faa553 Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever).
R=deadbeef@webrtc.org, juberti@webrtc.org

Review URL: https://codereview.webrtc.org/1263663002 .

Cr-Commit-Position: refs/heads/master@{#9692}
2015-08-10 19:22:59 +00:00
honghaiz
f421bdc68d Fix an NPE when creating TurnPort with a NULL socket.
BUG=4827

Review URL: https://codereview.webrtc.org/1241943002

Cr-Commit-Position: refs/heads/master@{#9601}
2015-07-17 23:22:02 +00:00
deadbeef
c5d0d95fd8 Ensuring that UDP TURN servers are always used as STUN servers.
This was already working in most cases, but not for some corner cases:
* If the PORTALLOCATOR_ENABLE_SHARED_SOCKET flag is not set
* If both a STUN server and TURN server are configured

I added unit tests for these cases, and centralized the code that gets
STUN server addresses in order to fix these and any related issues.

BUG=webrtc:4215

Review URL: https://codereview.webrtc.org/1215713003

Cr-Commit-Position: refs/heads/master@{#9596}
2015-07-16 17:22:28 +00:00
Erik Språng
efdce6927e Disable some PortAllocatorTest on asan due to flakiness
TBR=kjellander@webrtc.org
BUG=4743

Review URL: https://codereview.webrtc.org/1151173009

Cr-Commit-Position: refs/heads/master@{#9377}
2015-06-05 07:41:36 +00:00
Erik Språng
85cf3c0794 Revert "Disable some PortAllocatorTest on tsan due to flakiness"
This reverts commit 491bd534ef726456883ec372562d1c8fef82e7ca.

TBR=kjellander@webrtc.org
BUG=4743

Review URL: https://codereview.webrtc.org/1157743008

Cr-Commit-Position: refs/heads/master@{#9375}
2015-06-05 07:31:13 +00:00
Erik Språng
491bd534ef Disable some PortAllocatorTest on tsan due to flakiness
TBR=kjellander@webrtc.org
BUG=4743

Review URL: https://codereview.webrtc.org/1160033005

Cr-Commit-Position: refs/heads/master@{#9369}
2015-06-04 12:57:59 +00:00
Jiayang Liu
d7e5c44e94 STUN allocation should not be disabled when using shared port and TURN servers are provided.
BUG=
R=juberti@google.com, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48229004

Cr-Commit-Position: refs/heads/master@{#9091}
2015-04-27 18:46:58 +00:00
Peter Thatcher
73ba7a690f Remove PORTALLOCATOR_ENABLE_BUNDLE, PortAllocatorSessionProxy, PortAllocatorSessionMuxer, and PortProxy.
R=decurtis@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/46809004

Cr-Commit-Position: refs/heads/master@{#8999}
2015-04-14 16:25:58 +00:00
guoweis@webrtc.org
f358aea7bf Fix WebRTC IP leaks.
WebRTC binds to individual NICs and listens for incoming Stun packets. Sending stun through this specific NIC binding could make OS route the packet differently hence exposing non-VPN public IP.

The fix here is
1. to bind to any address (0:0:0:0) instead. This way, the routing will be the same as how chrome/http is.
2. also, remove the any all 0s addresses which happens when we bind to all 0s.

BUG=4276
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39129004

Cr-Commit-Position: refs/heads/master@{#8418}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8418 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-18 18:44:14 +00:00
jiayl@webrtc.org
dacdd9403d Reland r7980:
Accept incoming pings before remote answer is set, to reduce connection latency.
Set ICE connection state to 'checking' after setting the remote answer, so that it can transition into 'connected' if the peer reflexive connection is up before any remote candidate is set. See more details in crbug/446908

BUG=4068, crbug/446908
R=juberti@webrtc.org, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38709004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8141 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-23 17:33:34 +00:00
jiayl@webrtc.org
7e5b380437 Fix a crash in AllocationSequence.
Internal bug 19074679.

BUG=
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38699004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8130 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-22 21:28:39 +00:00
pthatcher@webrtc.org
9657265f39 Revert "Accept incoming pings before remote answer is set to reduce connection latency."
This reverts r7980.

It was causing the ICE connected state to happen while still in the new state rather than going through the checking state, which was causing an ASSERT to fire, which was causing a crash.

Review URL: https://webrtc-codereview.appspot.com/41429004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8031 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-09 19:08:27 +00:00
jiayl@webrtc.org
c5fd66dcdf Accept incoming pings before remote answer is set to reduce connection latency.
BUG=4068
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/33509004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7980 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-29 19:23:37 +00:00
henrike@webrtc.org
269fb4bc90 move xmpp and p2p to webrtc
Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and
webrtc/p2p. Also makes libjingle use those version instead of the one in the talk folder.

BUG=3379

Review URL: https://webrtc-codereview.appspot.com/26999004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7549 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-28 22:20:11 +00:00
henrike@webrtc.org
28100cb388 Reverts r7459 "Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and webrtc/p2p."
BUG=N/A
TBR=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/29829004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7472 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-17 22:03:39 +00:00
henrike@webrtc.org
d1ba6d9cbf Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and webrtc/p2p.
BUG=3379
R=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/27709005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7459 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-15 17:30:28 +00:00