Commit graph

50 commits

Author SHA1 Message Date
Artem Titov
edacbd53de Reland "Implement packets_(sent | received) for RTCTransportStats"
This is a reland of fb6f975401. Related
issue in chromium is fixed here:
https://chromium-review.googlesource.com/c/chromium/src/+/2287294

Original change's description:
> Implement packets_(sent | received) for RTCTransportStats
>
> Bug: webrtc:11756
> Change-Id: Ic0caad6d4675969ef3ae886f50326e4a2e1cbfe7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178741
> Reviewed-by: Tommi <tommi@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31643}

Bug: webrtc:11756
Change-Id: I1e310e3d23248500eb7dabd23d0ce6c4ec4cb8c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178871
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31700}
2020-07-10 11:50:59 +00:00
Mirko Bonadei
9b35da880b Revert "Implement packets_(sent | received) for RTCTransportStats"
This reverts commit fb6f975401.

Reason for revert: Looks like this breaks chromium.webrtc.fyi:
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Mac%20Tester/6000
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/6209
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win7%20Tester/6177
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win8%20Tester/6299

Original change's description:
> Implement packets_(sent | received) for RTCTransportStats
> 
> Bug: webrtc:11756
> Change-Id: Ic0caad6d4675969ef3ae886f50326e4a2e1cbfe7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178741
> Reviewed-by: Tommi <tommi@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31643}

TBR=hbos@webrtc.org,tommi@webrtc.org,titovartem@webrtc.org

Change-Id: Icbb0974ba29cbddb614f1f37f8a2de1a7c56b571
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11756
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178868
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31665}
2020-07-08 09:42:41 +00:00
Artem Titov
fb6f975401 Implement packets_(sent | received) for RTCTransportStats
Bug: webrtc:11756
Change-Id: Ic0caad6d4675969ef3ae886f50326e4a2e1cbfe7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178741
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31643}
2020-07-07 10:45:05 +00:00
Magnus Flodman
55afe3885b Search and replace gendered terms according to style guide:
https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md#tools

Not changin the transcipt in
resources/audio_processing/conversational_speech/README.md

BUG=webrtc:11680

Change-Id: I36af34e4a4e0ec6161093c0045b7bbe1dbe4eb45
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177016
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31514}
2020-06-12 14:12:54 +00:00
Jonas Oreland
49864b7f0d Add forget_learned_state to IceControllerInterface
This patch enables an IceController to use
Connection::ForgetLearnedState by returning it
in a SwitchResult, that will cause P2PTransportChannel
to call the method.

BUG: webrtc:11463
Change-Id: I098bbbd2fb2961822b165770189ac0c2225d1cb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176511
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31458}
2020-06-08 07:46:54 +00:00
Peter Thatcher
743b9b258c Disable remote ICE candidate DNS lookups when the IceTransportPolicy is Relay or None
Bug: webrtc:11597
Change-Id: Id3884a2b5f0fc35880c7401c43ca25fee8346519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175960
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31389}
2020-05-29 16:10:54 +00:00
Jonas Oreland
e309651f33 Don't SetNeedsIceRestartFlag if widening candidate filter when surface_ice_candidates_on_ice_transport_type_changed
This patch fixes a minor bug in the implementation of
surface_ice_candidates_on_ice_transport_type_changed. The existing
implementation correctly handles the surfacing, but accidentally also
set the SetNeedsIceRestartFlag, which made _next_ offer contain
a ice restart.

Modified existing testcase to verify this.

Bug: webrtc:8939
Change-Id: If566e3249296467668627e5941495f6036cbd903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176127
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31363}
2020-05-27 08:42:10 +00:00
Markus Handell
ff84d86d9c P2PTransportChannel::OnCandidateResolved: fix resolver leak.
This change fixes a problem where the eventual destruction of a
completed resolver sometimes doesn't happen. This is because the
destruction is posted to the network thread, and if it's destroyed
before the closure is executed, the resolver is leaked.

The fix is in three parts:
1. The resolver->Destroy call is performed on closure destruction
   to make sure it will always run.
2. The closure is executed with task queue. This because the
   RTC_DCHECK on thread:140 fires with the invoker_.
3. It's not possible to guarantee the context Destroy is called on due
   to TaskQueue semantics. Therefore SignalThread::Destroy was changed
   to accept any calling context and only requiring it's the last
   public call to the object.

For unknown reasons, this leak doesn't trigger the leak checker, see
referred bugs for further investigation.

Bug: webrtc:7723, webrtc:11605, chromium:905542
Change-Id: I2681ff1d2416ccbc564974a65ac84781a9ed7aee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176125
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31359}
2020-05-26 18:10:00 +00:00
Danil Chapovalov
b85889d6d5 In p2p/ replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: I8da8eb4e2fc1613018b9df5c8f3dacb281107a4a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175907
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31339}
2020-05-25 08:33:50 +00:00
Philipp Hancke
e283d1ca64 add tcptype to prflx tcp candidates
Adds the missing tcptype to prflx tcp candidates as tcptype is mandatory per
RFC 6544 and if missing the candidate will contain double whitespace like this
  ... tcptype  generation ...
and will get rejected by the internal parser

BUG=webrtc:11423

Change-Id: Id61babd85cf43d56e9e6f9bf30d4cc9e00f00f60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170442
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30959}
2020-04-01 09:43:35 +00:00
Jonas Oreland
71fda3613c Extend NetworkRoute with more info about local/remote endpoints
This patch extends the NetworkRoute struct with more information
about local/remote endpoints. It adds
- adapter type
- adapter id
- relay

(previously it was "only" network_id)

The patch leaves the {local/remote}_network_id fields
around and populated since downstream projects depend
on them. They will be removed once they have migrated.

OWNER: srte@ call/ test/
OWNER: asapersson@ video/
OWNER: hta@ p2p/ pc/ rtc_base/

BUG: webrtc:11434
Change-Id: I9bcec385b40d707db385fef40b2c7a315dd35dd0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170628
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30848}
2020-03-20 16:55:38 +00:00
Jonas Oreland
496a335a87 Add field trials for sending ping on network switches
This patch introduces 2 new field trials that make p2p_transport_channel
to send ping on network switches. The purpose of this is to reduce the
time that the peers disagre on which connection to use.

- send_ping_on_switch_ice_controlling
Send a ping from the ICE_CONTROLLING side when switching connection.
- send_ping_on_nomination_ice_controlled
Send a ping from the ICE_CONTROLLED side when a connection has been
nominated by remote side.

The extra traffic by these PINGS are considered harmless since
network switches does not happen that often.

Bug: webrtc:10273
Change-Id: Id7abe268c79ceb2404c0543849d5666466e58d0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169550
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30668}
2020-03-03 12:25:55 +00:00
Danil Chapovalov
0c626afcf3 Use newer version of TimeDelta and TimeStamp factories in webrtc
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I87469d2e4a38369654da839ab7c838215a7911e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168402
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30491}
2020-02-10 12:21:17 +00:00
Steve Anton
f417238217 Remove iceRegatherIntervalRange
This was an ICE configuration experiment added a couple years ago that did not end up being used.

Bug: webrtc:11316
Change-Id: Iafb7e1c4f7b4598815f045808dbf6e470172f119
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167680
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30395}
2020-01-28 19:16:18 +00:00
Jerome Humbert
2869638b4d Avoid [[nodiscard]] warning C4834 with MSVC 2019
Avoid a warning-as-error of MSVC 2019 due to a test ignoring a
[[nodiscard]] return value:

C4834: discarding return value of function with 'nodiscard' attribute
Change-Id: I6b70d85769f311814393412830f48d0d8bfef63d

Bug: webrtc:11275
Change-Id: I6b70d85769f311814393412830f48d0d8bfef63d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164467
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30226}
2020-01-13 10:07:35 +00:00
Yves Gerey
bcea217667 Unflake P2PTransportChannelTest.TurnToTurnPresumedWritable.
Some messages were processed after involved objects were destructed,
a.k.a. 'use after free'.

This CL fixes that by disconnecting signals before fixture destruction,
honoring CreateChannel/DestroyChannel symmetry and following what is
done in similar test cases.

Bug: webrtc:11269
Change-Id: I122aca70a9978b752edc01e5f31583f4425f3624
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165685
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#30214}
2020-01-10 18:35:53 +00:00
Jonas Oreland
9a52bd733c STUN PING request
This patch introduces a new type of STUN ping,
GOOG_PING_REQUEST/RESPONSE which is similar
to a STUN_BINDING but does not transmit any values.

The Connection class automatically sends these if
no STUN attributes has changed since last call to Connection::Ping()
if the remote peer has signaled that it supports it.

BUG=webrtc:11100

Change-Id: Ib1b590f0b90ca6cb56f2eb07cd62f976e246bc8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159961
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30062}
2019-12-11 14:23:30 +00:00
Ying Wang
ef3998ffd1 Add directive to make webrtc metrics optional.
Bug: webrtc:11144
Change-Id: I4e75e6aec033784685de3670e880bb9f2b6ee8d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161043
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30040}
2019-12-09 13:55:50 +00:00
Jonas Oreland
d003662b15 Move SendBindingResponse to Connection
This patch moves the SendBindingResponse from Port
to Connection. This is a behavioural NOP, and I don't
understand why it was in Port in the firs place!

Found when working on GOOG_PING.

BUG=webrtc:11100

Change-Id: I0466c5381f08ec4926ca3380e6914f0bc0dfcf63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161081
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29963}
2019-11-29 16:32:14 +00:00
Jonas Oreland
98e745b302 make Connection::port() protected
This patch makes Connection::port() protected
and add explicit methods for the use cases instead
- network()     - port()->Network()
- generation()  - port()->generation()

This is done to easier mock a Connection.

BUG=webrtc:10647

Change-Id: I5b35477ed9f81d57cd871072874262d0a8af2d4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160784
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29929}
2019-11-27 11:13:48 +00:00
Jonas Oreland
2f74d5f793 Make IceController injectable
This patch is a follow up on
- https://webrtc-review.googlesource.com/c/src/+/158820
- https://webrtc-review.googlesource.com/c/src/+/158205

And makes the IceController injectable into P2PTransportChannel.
This is useful so that one can only modify the behaviour of the
the controller and still use the rest of the functionality of
P2PTransportChannel.

Bug: chromium:1024965
Change-Id: I36a1bc5cb4a60da46935ce8e4ce43e3bbbfeaf6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160188
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29882}
2019-11-22 19:45:32 +00:00
Jonas Oreland
313a10ecef p2p_transport_channel_unittest : put frequently used checks into functions.
this patch is puts frequently used check into a set of Check-functions.

the behavior of p2p_transport_channel_unittest is almost unchanged,
the minor change is that when waiting for connection between specific
addresses it waits and does not assume that a particular set of
local/remote addresses will be selected first.

the patch also changes a few EXPECT_ to ASSERT_ since the
tests are not useful where the first EXPECT fails.

BUG=webrtc:10647

Change-Id: Iddcc3c88114db80576e9ebc500572a00dbafdd84
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159882
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29812}
2019-11-18 07:31:24 +00:00
Niels Möller
191e38fb47 Delete gturn support
Delete enum RelayType and classes RelayPort and RelayServer.

See also PSA: https://groups.google.com/forum/?#!msg/discuss-webrtc/0ROpUXpw3Gs/eikIN-eEBwAJROpUXpw3Gs/eikIN-eEBwAJ

Bug: webrtc:10998
Change-Id: I1eab760dc73df9156cd1224cf99ad4a4c12ed882
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154522
Reviewed-by: Justin Uberti <juberti@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29677}
2019-11-04 08:31:07 +00:00
Jonas Oreland
1230fb787f ICE : add field trial for initial select dampening
The existing ICE stack will choose *the first* connection
that becomes writable.

It is possible that waiting a fixed time will choose a
better connection, avoiding a switch, and making the experience better
in total.

This patch is add two field trials to *explore*
that dimension. I.e the code will be rolled back once
experiments has been performed.

- initial_select_dampening, delays selection by X ms.
- initial_select_dampening_ping_received, delays selection for
  candidate that has received ping by X ms.

BUG=webrtc:11054

Change-Id: Ifcdde5183f318815e0f5db5802fbf6b542a95f5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158410
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29623}
2019-10-28 07:57:16 +00:00
Qingsi Wang
fdf54f2256 Stop pairing local relay candidates with remote mDNS candidates.
To avoid IP leak from the CreatePermission request, local relay
candidates must not be paired with remote mDNS candidates, per Section
3.3.2 in draft-ietf-rtcweb-mdns-ice-candidates-04.

Bug: webrtc:11038
Change-Id: I13aada79c812712b850293c7e17094dc8f77105a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157340
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Reviewed-by: Alex Drake <alexdrake@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29546}
2019-10-18 23:36:17 +00:00
Honghai Zhang
f8998cf8c4 Add a turn port prune policy to keep the first ready turn port.
Bug: webrtc:11026
Change-Id: I6222e9613ee4ce2dcfbb717e2430ea833c0dc373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155542
Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29470}
2019-10-14 19:08:23 +00:00
Jonas Oreland
c6404a1f1d Add field trial to reduce STUN pings.
This patch adds field trials for limiting no of STUN pings
- max_outstanding_pings
send this count of outstanding pings (pings w/o any response),
after that never send any before a reply is received.

NOTE:
1) This patch redoes https://webrtc.googlesource.com/src.git/+/0d28972d8f0659ab90cef7fd59ca54fb122b71bc
which was put into the StunRequestManager.
But that mechanism is not used for STUN pings.

2) This patch build on field-trial-parser added in https://webrtc-review.googlesource.com/c/src/+/156083

Bug: webrtc:10282
Change-Id: If2f22d2b61a28598a3aa93781c9857145576b7a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156162
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29467}
2019-10-14 14:57:17 +00:00
Jonas Oreland
4af78823fa Add feature to skip RELAY to non-RELAY connections
This patch adds a feature enabled using webrtc field trial
that remove connections between RELAY and non-RELAY candidates.

Bug: webrtc:11021
Change-Id: I924076277a843bffc1d25f6de14d2165f7012c4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156083
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29464}
2019-10-14 13:37:50 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Qingsi Wang
7cdcda9dd5 Use the sanitized pair when surfacing the candidate pair change event.
TBR=andersc@webrtc.org

Bug: None
Change-Id: Ie2c389fe966dada2768e3222e1f8da74e1715568
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150762
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Alex Drake <alexdrake@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29052}
2019-09-03 17:17:49 +00:00
Jonas Oreland
149dc72dfa Add support for RTCTransportStats.selectedCandidatePairChanges
This patch adds accounting and reporting needed for
newly added RTCTransportStats.selectedCandidatePairChanges,
https://w3c.github.io/webrtc-stats/#dom-rtctransportstats-selectedcandidatepairchanges

a) P2PTransportChannel counts everytime selected_connection_
is modified and reports this counter in the GetStats()-call.
b) RTCStatsCollector puts the counter into the standardized
stats object.

Bug: webrtc:10900
Change-Id: Ibaeca18706b8edcbcb44b0c6f2754854bcb545ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149830
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28987}
2019-08-28 13:22:08 +00:00
Qingsi Wang
7627fdd68a Sanitize the address field of peer-reflexive remote candidates.
Per the latest WebRTC stats spec
(https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatestats)
the address field of a peer-reflexive remote candidate should be concealed
until the same address is learnt via addIceCandidate.

This CL also refactors the sanitization-related code paths.

Bug: chromium:968161
Change-Id: I74c5da78232b2f604689867bda2937b8af827c4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149381
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28909}
2019-08-20 06:29:25 +00:00
Qingsi Wang
e5defb167a Sanitize the selected candidate pair in the public API.
The public API to obtain the selected candidate pair is changed to
GetSelectedCandidatePair in the ICE transport, and the returned pair
has address-sanitized candidates.

Bug: chromium:993878
Change-Id: I44f9d2385a84f9e22447108be2e57ef9e62671eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149080
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28869}
2019-08-15 18:36:35 +00:00
Alex Drake
00c7ecf625 Surface CandidatePairChange event
In order to be able to detect and measure context around candidate pair changes.

Bug: webrtc:10419
Change-Id: Iab0d7e7c80d925d1aa44617fc35975fdc6bbc6b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147340
Commit-Queue: Alex Drake <alexdrake@google.com>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28779}
2019-08-06 18:25:57 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Qingsi Wang
e3cc4895c2 Add logging and edit the field trial name for piggyback ICE check
acknowledgement.

Bug: None
Change-Id: I46fd46c70f7652424a454d62ec63a86af9f085db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143000
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28326}
2019-06-19 22:35:47 +00:00
Qingsi Wang
0894f0fd76 Add piggyback acknowledgement of the last ICE check received in
outgoing checks.

This change adds an experimental feature to allow an ICE agent to embed
the transaction ID of the latest connectivity check received from the
remote peer, as an auxiliary acknowledgement in additional to the check
response, in its own checks. This could facilitate the establishment of
ICE connectivity if the check process has a high RTT.

Bug: None
Change-Id: If3e6327720f13beeb14f103af3b5ffb4f9692998
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142682
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28316}
2019-06-19 06:27:52 +00:00
Qingsi Wang
1fe119f12f Change the gating of surfacing candidates on ICE transport type change
from a field trial to RTCConfiguration.

The test coverage is also expanded for the underlying feature.

Bug: None
Change-Id: Ic9c1362867e4a956c5453be7a9355083b6a442f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138980
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28143}
2019-06-03 18:41:13 +00:00
Jonas Oreland
e8e7d7b0bc Move Connection into it's own .h/.cc file.
This patch is a NOP and moves
- class Connection
- class ConnectionInfo
- class ProxyConnection

from port.{h/cc} to a new file called connection.{h/cc}

BUG=webrtc:10647

Change-Id: I89322d3421d272657e24a46b28ab6679fcdc9450
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137509
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28101}
2019-05-29 11:27:47 +00:00
Qingsi Wang
ecd3054b56 Replace a broken assumption in candidate gathering for mDNS candidates.
The gathering of host candidates with mDNS names is asynchronous and its
completion can happen after a srflx candidate is gathered by the same
underlying socket. We have a broken check in UDPPort::CreateConnection()
that assumes the gathering of host and srflx candidates is sequential.

This CL also does minor refactoring and clean-up.

Bug: chromium:944577
Change-Id: Ic28136a9515081f40b232a22fcbf4209814ed33a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138043
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28030}
2019-05-22 22:58:58 +00:00
Qingsi Wang
c129c359d7 Reland "Surface ICE candidates that match an updated candidate filter."
This is a reland of cd8d1cf68e

Original change's description:
> Surface ICE candidates that match an updated candidate filter.
> 
> After this change an ICE agent can surface candidates that do not match
> the previous filter but are allowed by the updated one. The candidate
> filter, as part of the internal implementation in the ICE transport,
> manifests the RTCIceTransportPolicy field in RTCConfiguration.
> 
> This new feature would allow an ICE agent to gather new candidates when
> the transport policy changes from e.g. 'relay' to 'all' without an ICE
> restart.
> 
> A caveat in the current implementation remains, and a candidate can
> surface multiple times if the transport policy, or the candidate filter
> directly, performs multiple transitions from a value that disallows to
> one that allows the underlying candidate type. For example, if the
> transport policy is updated by 'all' -> 'relay' -> 'all', the same host
> candidate can surface after the second update.
> 
> 
> Bug: webrtc:8939
> Change-Id: I92c2e07dafab225c702c5de28f47958a0d3270cc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132282
> Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
> Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
> Reviewed-by: Seth Hampson <shampson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27674}

Bug: webrtc:8939
Change-Id: I9c32b1ea05028ecd937ab4912779dd958faf734f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133582
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27694}
2019-04-18 19:33:41 +00:00
Qingsi Wang
797ede8e71 Revert "Surface ICE candidates that match an updated candidate filter."
This reverts commit cd8d1cf68e.

Reason for revert: breaks an internal project

Original change's description:
> Surface ICE candidates that match an updated candidate filter.
> 
> After this change an ICE agent can surface candidates that do not match
> the previous filter but are allowed by the updated one. The candidate
> filter, as part of the internal implementation in the ICE transport,
> manifests the RTCIceTransportPolicy field in RTCConfiguration.
> 
> This new feature would allow an ICE agent to gather new candidates when
> the transport policy changes from e.g. 'relay' to 'all' without an ICE
> restart.
> 
> A caveat in the current implementation remains, and a candidate can
> surface multiple times if the transport policy, or the candidate filter
> directly, performs multiple transitions from a value that disallows to
> one that allows the underlying candidate type. For example, if the
> transport policy is updated by 'all' -> 'relay' -> 'all', the same host
> candidate can surface after the second update.
> 
> 
> Bug: webrtc:8939
> Change-Id: I92c2e07dafab225c702c5de28f47958a0d3270cc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132282
> Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
> Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
> Reviewed-by: Seth Hampson <shampson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27674}

TBR=shampson@webrtc.org,qingsi@webrtc.org,jeroendb@webrtc.org,sukhanov@webrtc.org

Change-Id: Idd51a640e55a612b42fe8b69e05dff57a22d021a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8939
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133581
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27677}
2019-04-17 21:22:06 +00:00
Qingsi Wang
cd8d1cf68e Surface ICE candidates that match an updated candidate filter.
After this change an ICE agent can surface candidates that do not match
the previous filter but are allowed by the updated one. The candidate
filter, as part of the internal implementation in the ICE transport,
manifests the RTCIceTransportPolicy field in RTCConfiguration.

This new feature would allow an ICE agent to gather new candidates when
the transport policy changes from e.g. 'relay' to 'all' without an ICE
restart.

A caveat in the current implementation remains, and a candidate can
surface multiple times if the transport policy, or the candidate filter
directly, performs multiple transitions from a value that disallows to
one that allows the underlying candidate type. For example, if the
transport policy is updated by 'all' -> 'relay' -> 'all', the same host
candidate can surface after the second update.


Bug: webrtc:8939
Change-Id: I92c2e07dafab225c702c5de28f47958a0d3270cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132282
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27674}
2019-04-17 19:29:31 +00:00
Sebastian Jansson
d624c3903c Make MessageQueue processing an optional feature of FakeClock
This is used to avoid thread processing in simulated time
controller. This saves up to 30% execution time in debug builds.

Bug: webrtc:10365
Change-Id: Ie83dfb2468d371e4687d28c776acf7e23eb411d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133173
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27666}
2019-04-17 14:10:16 +00:00
Mirko Bonadei
6a489f22c7 Fully qualify googletest symbols.
Semi-automatically created with:

git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g"
git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g"
git cl format

After this, two .cc files failed to compile and I have fixed them
manually.

Bug: webrtc:10523
Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27526}
2019-04-09 17:18:20 +00:00
Seth Hampson
98335f8093 Fixing webrtc::IceTransportState.
Currently the IceTransportState goes to connected before the connection
is writable and also goes to checking before any candidate pairs are
being checked. This change fixes these cases.

Bug: webrtc:10352, chromium:933802
Change-Id: I64a67c7f76a94a6be9da413740ddc8762fe966ce
Reviewed-on: https://webrtc-review.googlesource.com/c/124102
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26842}
2019-02-25 18:57:19 +00:00
Steve Anton
ae226f65c8 Use Abseil container algorithms in p2p/
Bug: None
Change-Id: I02dd19efa201bd9d55d0f7c2e1496693017a6848
Reviewed-on: https://webrtc-review.googlesource.com/c/120001
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26455}
2019-01-29 21:52:18 +00:00
Jonas Olsson
df919fb425 Don't pretend we've received an end-of-candidates indication.
Since end-of-candidates signalling isn't implemented yet, the ice transport shouldn't reach completed. We also shouldn't assume that the transport has failed because gathering is complete without candidates, as we might still get remote candidates.

Bug: chromium:922588
Change-Id: I332f57be494efc775819d80908e9f39610311f82
Reviewed-on: https://webrtc-review.googlesource.com/c/118741
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26365}
2019-01-23 10:16:43 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Renamed from p2p/base/p2ptransportchannel_unittest.cc (Browse further)