Commit graph

117 commits

Author SHA1 Message Date
Niels Möller
646fddc3c9 Fix TCPPort::SetOption to apply options to the accepted sockets
The AsyncListenSocket::SetOption method then gets unused, and can be
deleted.

Bug: webrtc:13065
Change-Id: Idcf70a75b96036290fdceff6e0f96a8d5617f87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236580
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35302}
2021-11-03 11:02:46 +00:00
Philipp Hancke
08a6e35848 Reland "Revert "Reland "remove stun origin support"""
This reverts commit 3b18208f13
and is the third attempt at removing stun origin support

Bug: webrtc:12132
Change-Id: Ic41a6d011fb6239907a257cc4c81ec4d2923dc4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236260
Reviewed-by: Taylor Brandstetter <deadbeef@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35294}
2021-11-02 09:53:11 +00:00
Niels Möller
d30ece1804 Reland "Take out listen support from AsyncPacketSocket"
This is a reland of b141c162ee

Original change's description:
> Take out listen support from AsyncPacketSocket
>
> Moved to new interface class AsyncListenSocket.
>
> Bug: webrtc:13065
> Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35234}

Bug: webrtc:13065
Change-Id: I88bebdd80ebe6bcf6ac635023924d79fbfb76813
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235960
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35260}
2021-10-25 08:26:56 +00:00
Evan Shrubsole
1f30c2ba9b Revert "Take out listen support from AsyncPacketSocket"
This reverts commit b141c162ee.

Reason for revert: Breaking WebRTC rolls. See https://ci.chromium.org/ui/b/8832847811929676465 for an example failed build.

Original change's description:
> Take out listen support from AsyncPacketSocket
>
> Moved to new interface class AsyncListenSocket.
>
> Bug: webrtc:13065
> Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35234}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:13065
Change-Id: Id5d5b35cb21704ca4e3006caf1636906df062609
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235824
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35249}
2021-10-20 15:52:03 +00:00
Niels Möller
b141c162ee Take out listen support from AsyncPacketSocket
Moved to new interface class AsyncListenSocket.

Bug: webrtc:13065
Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35234}
2021-10-19 11:17:02 +00:00
Taylor Brandstetter
3b18208f13 Revert "Reland "remove stun origin support""
This reverts commit 11a89c99e9.

Reason for revert: Breaks downstream code which is using the TurnPort constructor.

Original change's description:
> Reland "remove stun origin support"
>
> This is a reland of ba29ce320f
> readding the origin to the CreateRelayPortArgs structure to not break
> downstream tests yet:
>   https://webrtc-review.googlesource.com/c/src/+/235300/1..2
>
> Original change's description:
> > remove stun origin support
> >
> > Bug: webrtc:12132
> > Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35202}
>
> Bug: webrtc:12132
> Change-Id: Ied840b59bb7c9497e98f9b80eb0a54d30008a40f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235300
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35220}

TBR=deadbeef@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com,philipp.hancke@googlemail.com

Change-Id: If16cedb8ccba22d83c919f64f7234873ba859a75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12132
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235346
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35221}
2021-10-15 21:27:48 +00:00
Philipp Hancke
11a89c99e9 Reland "remove stun origin support"
This is a reland of ba29ce320f
readding the origin to the CreateRelayPortArgs structure to not break
downstream tests yet:
  https://webrtc-review.googlesource.com/c/src/+/235300/1..2

Original change's description:
> remove stun origin support
>
> Bug: webrtc:12132
> Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35202}

Bug: webrtc:12132
Change-Id: Ied840b59bb7c9497e98f9b80eb0a54d30008a40f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35220}
2021-10-15 19:46:24 +00:00
Harald Alvestrand
6f8fa5af77 Reland "Use AsyncDnsResolver API in bindings and tests"
This reverts commit fc5a4f74ac.

Reason for revert: Added back support for old API

Original change's description:
> Revert "Use AsyncDnsResolver API in bindings and tests"
>
> This reverts commit a0577605b0.
>
> Reason for revert: Speculative revert due to downstream tests
>
> Original change's description:
> > Use AsyncDnsResolver API in bindings and tests
> >
> > Bug: webrtc:12598
> > Change-Id: Ia4db91bf6dcd257cd85f4089dee4c7bbea433216
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234342
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Markus Handell <handellm@webrtc.org>
> > Reviewed-by: Markus Handell <handellm@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35154}
>
> TBR=hta@webrtc.org,handellm@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I57f3ff70b6374e7be670526a90dfb1651e9b1148
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12598
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234382
> Reviewed-by: Björn Terelius <terelius@google.com>
> Commit-Queue: Björn Terelius <terelius@google.com>
> Cr-Commit-Position: refs/heads/main@{#35157}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:12598
Change-Id: Icf2cee36746006979b790e5846a2889b54d25386
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235204
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35211}
2021-10-14 17:48:46 +00:00
Artem Titov
41205b3c4d Revert "remove stun origin support"
This reverts commit ba29ce320f.

Reason for revert: Breaks downstream projects

Original change's description:
> remove stun origin support
>
> Bug: webrtc:12132
> Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35202}

TBR=deadbeef@webrtc.org,hta@webrtc.org,philipp.hancke@googlemail.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5f3a7a15c7da8e752569683bfeac91f2160a4f55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12132
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235241
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35209}
2021-10-14 15:08:28 +00:00
Philipp Hancke
ba29ce320f remove stun origin support
Bug: webrtc:12132
Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35202}
2021-10-14 11:27:46 +00:00
Björn Terelius
fc5a4f74ac Revert "Use AsyncDnsResolver API in bindings and tests"
This reverts commit a0577605b0.

Reason for revert: Speculative revert due to downstream tests

Original change's description:
> Use AsyncDnsResolver API in bindings and tests
>
> Bug: webrtc:12598
> Change-Id: Ia4db91bf6dcd257cd85f4089dee4c7bbea433216
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234342
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35154}

TBR=hta@webrtc.org,handellm@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I57f3ff70b6374e7be670526a90dfb1651e9b1148
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12598
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234382
Reviewed-by: Björn Terelius <terelius@google.com>
Commit-Queue: Björn Terelius <terelius@google.com>
Cr-Commit-Position: refs/heads/main@{#35157}
2021-10-06 15:05:57 +00:00
Niels Möller
6d19d14c26 Add AsyncListenSocket, as alias for AsyncPacketSocket
A preparation for splitting server sockets out into a separate
interface, see https://webrtc-review.googlesource.com/c/src/+/232607.

Transition plan:

1. Land this cl.

2. Update downstream code to use the new name.

3. Attempt landing
   https://webrtc-review.googlesource.com/c/src/+/232607. May need
   additional steps to not break downstream implementations of
   PacketSocketFactory::CreateServerTcpSocket.

Bug: webrtc:13065
Change-Id: Ife448c705222f4c9f66a096e3dc7eb07e0f9c3af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233700
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35155}
2021-10-06 11:42:50 +00:00
Harald Alvestrand
a0577605b0 Use AsyncDnsResolver API in bindings and tests
Bug: webrtc:12598
Change-Id: Ia4db91bf6dcd257cd85f4089dee4c7bbea433216
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234342
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35154}
2021-10-06 11:18:30 +00:00
Niels Möller
4a1c2c4754 Delete wiring of SignalAddressReady for TCP ports
This feature is used only by chromium, and only for UDP sockets.

Bug: webrtc:13065
Change-Id: I207ea643aa57cf23bdd36266895f65f1ee251aaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35106}
2021-09-28 10:05:05 +00:00
Niels Möller
9def99487e Delete BasicPacketSocketFactory constructor with thread argument
In callers where it's non-trivial to explicitly pass the right
SocketFactory, pull the call to rtc::Thread::socketserver() into the
caller, with a TODO comment.

Bug: webrtc:13145
Change-Id: I029d3adca385d822180e089f016c3778e0d4fd0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231227
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35063}
2021-09-22 12:15:06 +00:00
Niels Möller
d0b8879770 Delete AsyncSocket class, merge into Socket class
Bug: webrtc:13065
Change-Id: I13afee2386ea9c4de0e4fa95133f0c4d3ec826e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227031
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34787}
2021-08-17 15:39:25 +00:00
Artem Titov
2dbb4c9775 Use backticks not vertical bars to denote variables in comments for /p2p
Bug: webrtc:12338
Change-Id: Ie047b750cdf7ea2efe7a4632d18d5ed719c5ea83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226952
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34570}
2021-07-27 18:51:02 +00:00
Harald Alvestrand
07d83c8a9a Modified STUN verification functions
The new verification makes verification a function on a message.
It also stores the password used in the request message, so that
it is easily accessible when verifying the response.

Bug: chromium:1177125
Change-Id: I505df4b54214643a28a6b292c4e2262b9d97b097
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209060
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33366}
2021-03-02 10:34:17 +00:00
Lahiru Ginnaliya Gamathige
c3a486c41e Delete unused sigslot variables.
- Usage of these sigslots are removed in previous changes in WebRTC
  and downstream repositories.
- Remove one more usage of the variables in port_unnittests.

No-Try: True
Bug: webrtc:11943
Change-Id: Ia424f598248a5d9a0cf88f041641a3dd8aa6effe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206500
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33205}
2021-02-09 14:41:14 +00:00
Lahiru Ginnaliya Gamathige
3ba7beba29 Use callback_list for port destroy operation.
- During the process had to change port_interface sigslot usage and
  async_packet_socket sigslot usage.
- Left the old code until down stream projects are modified.

Change-Id: I59149b0bb982bacd4b57fdda51df656a54fe9e68
Bug: webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191520
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33167}
2021-02-04 16:34:02 +00:00
Niels Möller
091617dda8 Change TestStunServer::Create to take a SocketServer rather than a thread as argument.
Bug: None
Change-Id: I8b140c8cb40787473411ae55da3738166340127f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/39512
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32753}
2020-12-03 08:31:41 +00:00
Jonas Oreland
fa54364cea Update STUN attributes with latest IANA registrations
https://www.iana.org/assignments/stun-parameters/stun-parameters.xhtml

Bug: webrtc:0
Change-Id: Id3addf432abdfe0b5c236dc5b080e64744c18114
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184341
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32113}
2020-09-16 11:13:14 +00:00
Jonas Oreland
21433cae74 Add field trial to let idle connection live longer than 30s
A connection is currently deleted if it has not recevied anything for
30s. This patch adds a field trial that allows modifying this value
if no pings are outstanding.

The motivation for this is to experiment with pinging slower than
once per 30s in order to save battery.

Bug: webrtc:10282
Change-Id: I3272b9d68d44fc30379bd9a6c643db6b09766486
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175005
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31239}
2020-05-13 13:20:09 +00:00
Taylor Brandstetter
fb4351b085 Enforce "comprehension-required" STUN rules.
If a STUN attribute is in the "comprehension-required" range
(0x0000-0x7FFF), and the implementation does not recognize it, this
should be treated as an error (as per RFC5389), with different behavior
depending on the type of the message received.

Bug: webrtc:9063
Change-Id: Ic31b0cdd3c26772c21d770b44fe4ee4a1b47030a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/64500
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30925}
2020-03-28 02:07:49 +00:00
Jonas Oreland
ef60c2b0ad Implement Connection::ForgetLearnedState()
This patch adds a new ForgetLearnedState() method on a Connection.
The method, puts the connection into a state similar to
when it was just created.

- write_state = STATE_WRITE_INIT
- receving = false
- throw away all pending request
- reset RttEstimate

All other state is kept unchanged.

Note: It does not trigger SignalStateChange

A subsequent patch will expose the method to the IceController.

BUG: webrtc:11463
Change-Id: I055e8cd067e1bc4fd5ad64dd10f458554dbc87e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171805
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30916}
2020-03-27 08:24:43 +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
Jonas Oreland
7a284e1614 TCPConnection: Defer FailAndPrune by signaling to self
What steps will reproduce the problem?
1. Connect a TCPPort, creating a TCPConnection
2. Disconnect the interface (e.g turn it off in android)
3. Send Ping on the TCPConnection

Crash.
The TCPConnection calls FailAndPrune when it fails to reconnect
the TCPConnection. FailAndPrune which removes the StunRequests.
When this is called from the Ping() code,
that will still access the StunRequest after the call to the Connection.

Solution: Instead of calling FailAndPrune deep down in the Ping()-stack
post a message to self to do this with a "clean" stack instead.

BUG: webrtc:11315
Change-Id: Id328b1b7c92311fa5b9adbfd2eb1dd14bf19805d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167522
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30389}
2020-01-28 09:50:06 +00:00
Jonas Oreland
219d8ce889 GOOG_PING: improve handshake
This patch improves handshake wrt GOOG_PING support so that
- if goog_ping_enable: sender send it's goog-ping version until it gets
STUN_BINDING_RESPONSE
- receiver only sends it's goog-ping-version if getting a
goog-ping-version in the request

This means that the overhead of STUN_ATTR_GOOG_MISC_INFO is only
- added on STUN_BINDING_REQUEST until a response is received.
- added on STUN_BINDING_RESPONSE if remote peer request it.

This is wire compatible with older versions so that
- new sender will enable GOOG_PING with new/old receiver.
- old sender will enable GOOG_PING with old receiver.
- old version will not enable GOOG_PING with new receiver
  (receiver expecting sender to announce first).

BUG: webrtc:11100
Change-Id: Ib3434c593988188150f4c7506918139aaf138d0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165787
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30269}
2020-01-15 16:09:38 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +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
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
Patrik Höglund
56d945233d Move stun.h to api/.
We now have two downstream users of stun.h, so it appears to be
generally usable. I put this in a new dir networking/, but I'm open to
suggestions here (maybe some things in api/ should move in there).

I checked what our downstream users are actually using, and it's

cricket::ComputeStunCredentialHash
cricket::<constants>
cricket::TurnMessage
cricket::GetStunErrorResponseType
cricket::StunAttribute::CreateAddress
cricket::StunErrorCodeAttribute
cricket::StunByteStringAttribute
StunAttribute::CreateUnknownAttributes
cricket::TurnErrorType
cricket::StunMessage

I reckoned that was pretty much everything in stun.h, so I didn't
bother splitting it up. They don't use every function and constant
in there, but all _types_ of functions and constants, so for the
sake of coherence I don't think it makes sense to split it.

There's some old stuff in there like GTURN which could arguably
be split out, but it should likely go away soon anyway, so I don't
think it's worth the effort.

Steps:
1) land this
2) update downstream to point to the new header and target
3) remove p2p/base:stun_types.

Bug: webrtc:11091
Change-Id: I1f05bf06055475d25601197ec6fefb8d3b55e8e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159923
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29822}
2019-11-18 16:11:27 +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
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
Patrik Höglund
7d00342f66 Remove old packet socket factory header.
Bug: webrtc:7447
Change-Id: I367e624070561349a2e98c00d1ce97ad8d12edeb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153347
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29207}
2019-09-17 11:21:45 +00:00
Patrik Höglund
662e31ffec Prepare to move packet_socket_factory to api/.
I gave up on removing proxy_info, user_agent and tcp_options. I don't
think it's feasible to remove them without removing all the proxy code.
The assumption that you can set the proxy and user agent long after
you have created the factory is entrenched in unit tests and the code
itself. So is the ability to set tcp opts depending on protocol or
endpoint properties.

It may be easier to untangle proxy stuff from the factory later,
when it becomes a more first-class citizen and isn't passed via
the allocator.

Requires https://chromium-review.googlesource.com/c/chromium/src/+/1778870
to land first.

Bug: webrtc:7447
Change-Id: Ib496e2bb689ea415e9f8ec1dfedff13a83fa4a8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150799
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29091}
2019-09-06 09:09:02 +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
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
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
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00
Niels Möller
e693381cda Delete struct rtc::PacketTime.
Replaced by a int64_t representing time in us. To aid transition of
downstream code, rtc::PacketTime is made an alias for int64_t.

Bug: webrtc:9584
Change-Id: Ic3a5ee87d6de2aad7712894906dab074f1443df9
Reviewed-on: https://webrtc-review.googlesource.com/c/91860
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25503}
2018-11-05 16:21:39 +00:00
Steve Anton
f7dd9df7e1 Change TurnPort::Create to return a unique_ptr
Bug: webrtc:9198
Change-Id: I13c9eab549b4973ce4f8fd2f562f1ff7f7e0a2cb
Reviewed-on: https://webrtc-review.googlesource.com/c/105182
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25100}
2018-10-10 23:22:22 +00:00
Steve Anton
a8f1e56532 Change Port::Create methods to return a unique_ptr
Bug: webrtc:9198
Change-Id: Iab3387857b7e7826b0d71863893912f3a8a9b95b
Reviewed-on: https://webrtc-review.googlesource.com/c/104260
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25097}
2018-10-10 19:05:47 +00:00
Steve Anton
11358fe9b9 Use unique_ptr in port_unittest
Bug: webrtc:9198
Change-Id: I8a86aff5aeccd411a6a31d0730a8662f1b7dc63c
Reviewed-on: https://webrtc-review.googlesource.com/c/104240
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25072}
2018-10-09 23:14:51 +00:00
Karl Wiberg
4b6c2ec5db Remove using declaration for rtc::Buffer
It interferes with a future refactoring, and isn't all that useful
anyway.

Bug: webrtc:9810
Change-Id: I46163d7921d39249615b7eea60306c598f13c128
Reviewed-on: https://webrtc-review.googlesource.com/c/103443
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24970}
2018-10-04 09:13:48 +00:00
Sergey Silkin
9c147ddc91 Revert "Add SSLConfig object to IceServer."
This reverts commit 4f085434b9.

Reason for revert: breaks downstream projects.

Original change's description:
> Add SSLConfig object to IceServer.
> 
> This is a rollforward of https://webrtc-review.googlesource.com/c/src/+/96020,
> with the addition of setting the old tlsCertPolicy, tlsAlpnProtocols and
> tlsEllipticCurves in the RTCIceServer initializer, for backwards compatibility.
> 
> Bug: webrtc:9662
> Change-Id: I28706ed4ff5abe3f7f913f105779f0e5412aeac5
> Reviewed-on: https://webrtc-review.googlesource.com/98762
> Commit-Queue: Diogo Real <diogor@google.com>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24696}

TBR=steveanton@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,kthelgason@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org,diogor@google.com

Change-Id: I1cb64b63fec688b4ac90c2fa368eaf0bc11046af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9662
Reviewed-on: https://webrtc-review.googlesource.com/99880
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24701}
2018-09-12 10:46:04 +00:00
Diogo Real
4f085434b9 Add SSLConfig object to IceServer.
This is a rollforward of https://webrtc-review.googlesource.com/c/src/+/96020,
with the addition of setting the old tlsCertPolicy, tlsAlpnProtocols and
tlsEllipticCurves in the RTCIceServer initializer, for backwards compatibility.

Bug: webrtc:9662
Change-Id: I28706ed4ff5abe3f7f913f105779f0e5412aeac5
Reviewed-on: https://webrtc-review.googlesource.com/98762
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24696}
2018-09-11 23:28:46 +00:00
Ying Wang
1d52d2c24d Revert "Add SSLConfig object to IceServer."
This reverts commit 7f1ffcccce.

Reason for revert: Speculative revert

Original change's description:
> Add SSLConfig object to IceServer.
> 
> This is being added to allow greater configurability to TLS connections.
> tlsAlpnProtocols, tlsEllipticCurves and tlsCertPolicy will be removed from IceServer in a
> follow-up CL.
> 
> Bug: webrtc:9662
> Change-Id: I33cb804b02c26c662ed2a28c76f9a9dc2df40f36
> Reviewed-on: https://webrtc-review.googlesource.com/96020
> Commit-Queue: Diogo Real <diogor@google.com>
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Reviewed-by: Benjamin Wright <benwright@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24559}

TBR=steveanton@webrtc.org,sakal@webrtc.org,kthelgason@webrtc.org,juberti@webrtc.org,emadomara@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org,diogor@google.com

Change-Id: Iae9fc68b77f743876bda36fc2a04f6d791aae8e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9662
Reviewed-on: https://webrtc-review.googlesource.com/98000
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24563}
2018-09-05 08:15:29 +00:00
Diogo Real
7f1ffcccce Add SSLConfig object to IceServer.
This is being added to allow greater configurability to TLS connections.
tlsAlpnProtocols, tlsEllipticCurves and tlsCertPolicy will be removed from IceServer in a
follow-up CL.

Bug: webrtc:9662
Change-Id: I33cb804b02c26c662ed2a28c76f9a9dc2df40f36
Reviewed-on: https://webrtc-review.googlesource.com/96020
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24559}
2018-09-04 22:46:19 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Danil Chapovalov
00c7183614 Replace rtc::Optional with absl::optional in media, ortc, p2p
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameters 'media ortc p2p':
find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I19167714af7cc1436d34cfcba6c8b3718d8e677b
Reviewed-on: https://webrtc-review.googlesource.com/83731
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23638}
2018-06-16 07:09:59 +00:00
Benjamin Wright
d6f86e8fca This changeset adds dependency injection support for SSL Root Certs.
This extends the API surface so that
custom certificates can be provided by an API user in both the standalone and
factory creation paths for the OpenSSLAdapter. Prior to this change the SSL
roots were hardcoded in a header file and directly included into
openssladapter.cc. This forces the 100 kilobytes of certificates to always be
compiled into the library. This is undesirable in certain linking cases where
these certificates can be shared from another binary that already has an
equivalent set of trusted roots hard coded into the binary.

Support for removing the hard coded SSL roots has also been added through a new
build flag. By default the hard coded SSL roots will be included and will be
used if no other trusted root certificates are provided.

The main goal of this CL is to reduce total binary size requirements of WebRTC
by about 100kb in certain applications where adding these certificates is
redundant.

Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f

Bug: chromium:526260
Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f
Reviewed-on: https://webrtc-review.googlesource.com/64841
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23180}
2018-05-09 00:24:05 +00:00
Sebastian Jansson
5f83cf0c6d Replacing rtc::TimeDelta with webrtc::TimeDelta.
This removes the redundant type and replaces all usages. A slight change
in behavior is that we no longer get nanosecond resolution. This should
not matter since no current code requires nanosecond resolution.

Bug: webrtc:9155
Change-Id: I04334e08c686d95731621a6c8a7e40400d0ae3b2
Reviewed-on: https://webrtc-review.googlesource.com/71163
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23174}
2018-05-08 13:22:53 +00:00
Qingsi Wang
866e08d282 Make rtc::Optional IceConfig parameters interpreted consistently.
The convention is reinforced so that setting a rtc::Optional IceConfig
parameter to null restores the default value. Helper getters are added
to IceConfig to provide either user-defined value or the default.
Shared constants and config defaults used in p2p are moved to
p2pconstants.h/cc for future management with sanity checks.

Bug: webrtc:8993
Change-Id: I976cf1eef5a654b8911f449248bb2f3086279db8
Reviewed-on: https://webrtc-review.googlesource.com/61149
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22575}
2018-03-23 02:10:54 +00:00
Qingsi Wang
22e623ad68 Add configurable threshold for writability state update.
Add configurable parameters in RTCConfiguration with the default value
given by the constants CONNECTION_WRITE_CONNECT_TIME and
CONNECTION_WRITE_CONNECT_FAILURES in the ICE implementation. These two
parameters define the time period for which a candidate pair must wait
for ping response and the minimum number of connectivity checks that
the pair must send without response before its state becomes unreliable
from writable as defined in the current ICE implementation.

Bug: webrtc:8988
Change-Id: I484599b7d776489a87741ffea8926df766095da9
Reviewed-on: https://webrtc-review.googlesource.com/60704
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22411}
2018-03-13 18:54:03 +00:00
Qingsi Wang
4ff5443e4e Fix bugs in collecting STUN candidate stats and configuring STUN
candidate keepalive intervals.

StunStats for a STUN candidate cannot be updated after the initial report
in the stats collector. This is caused by the early return of cached
candidate reports for future queries after the initial report creation.

The STUN keepalive interval cannot be configured for UDPPort because of
incorrect type screening, where only StunPort was supported.

TBR=pthatcher@webrtc.org

Bug: webrtc:8951
Change-Id: I0c9c414f43e6327985be6e541e17b5d6f248a79d
Reviewed-on: https://webrtc-review.googlesource.com/58560
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22278}
2018-03-04 21:37:21 +00:00
Taylor Brandstetter
6e2e7ce419 Reland "Move JsepTransport from p2p/base to pc/."
This is a reland of 4770fd935a
Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

Bug: webrtc:8636
Change-Id: Ibce42be898b96dd8e0266b595611d2ffc86581a8
Reviewed-on: https://webrtc-review.googlesource.com/34586
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21371}
2017-12-19 20:50:41 +00:00
Oleh Prypin
8424acdde3 Revert "Move JsepTransport from p2p/base to pc/."
This reverts commit 4770fd935a.

Reason for revert: breaks downstream projects

Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,pthatcher@webrtc.org

Change-Id: Ia72c6d7f185a95b21fd0aec90e7fdc00cb1fb423
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8636
Reviewed-on: https://webrtc-review.googlesource.com/34600
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21335}
2017-12-18 21:00:05 +00:00
Taylor Brandstetter
4770fd935a Move JsepTransport from p2p/base to pc/.
The JsepTransport class is moved to pc/ and the utility methods and
enums are moved to where they are used.

With JsepTransport moved to pc/, JsepTransport can depend on objects in
pc/ including RtpTranport, SrtpTransport etc.

Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7

Bug: webrtc:8636
Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
Reviewed-on: https://webrtc-review.googlesource.com/33701
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21333}
2017-12-18 18:59:43 +00:00
Steve Anton
babf91738c Fix cpplint errors in port/port_unittest
Bug: webrtc:5273
Change-Id: Id76af16956e5c25a7f897a8e36e6883616387676
Reviewed-on: https://webrtc-review.googlesource.com/26442
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20942}
2017-11-29 19:57:09 +00:00
Mirko Bonadei
675513b96a Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:

for m in PLOG \
  LOG_TAG \
  LOG_GLEM \
  LOG_GLE_EX \
  LOG_GLE \
  LAST_SYSTEM_ERROR \
  LOG_ERRNO_EX \
  LOG_ERRNO \
  LOG_ERR_EX \
  LOG_ERR \
  LOG_V \
  LOG_F \
  LOG_T_F \
  LOG_E \
  LOG_T \
  LOG_CHECK_LEVEL_V \
  LOG_CHECK_LEVEL \
  LOG
do
  git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format

Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
2017-11-09 11:56:32 +00:00
Jonas Oreland
bdcee28ee9 TurnCustomizer - an interface for modifying stun messages sent by TurnPort
This patch adds an interface that allows modification of stun messages
sent by TurnPort. A user can inject a TurnCustomizer on the RTCConfig
and the TurnCustomizer will be invoked by TurnPort before sending
message. This allows user to e.g add custom attributes as described
in rtf5389.

BUG=webrtc:8313

Change-Id: I6f4333e9f8ff7fd20f32677be19285f15e1180b6
Reviewed-on: https://webrtc-review.googlesource.com/7618
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20233}
2017-10-11 07:45:29 +00:00
Guido Urdaneta
604427b875 Revert "TurnCustomizer - an interface for modifying stun messages sent by TurnPort"
This reverts commit b23ed7f1af.

Reason for revert: Breaks Chromium FYI build

Sample error log:

../../remoting/test/fake_port_allocator.cc:52:7: error: no matching constructor for initialization of 'cricket::BasicPortAllocator'
    : BasicPortAllocator(network_manager, socket_factory),
      ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/p2p/client/basicportallocator.h:32:12: note: candidate constructor not viable: requires single argument 'network_manager', but 2 arguments were provided
  explicit BasicPortAllocator(rtc::NetworkManager* network_manager);
           ^
../../third_party/webrtc/p2p/client/basicportallocator.h:27:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class BasicPortAllocator : public PortAllocator {
      ^
../../third_party/webrtc/p2p/client/basicportallocator.h:29:3: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,
  ^
../../third_party/webrtc/p2p/client/basicportallocator.h:33:3: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,
  ^
../../third_party/webrtc/p2p/client/basicportallocator.h:36:3: note: candidate constructor not viable: requires 5 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,

Original change's description:
> TurnCustomizer - an interface for modifying stun messages sent by TurnPort
> 
> This patch adds an interface that allows modification of stun messages
> sent by TurnPort. A user can inject a TurnCustomizer on the RTCConfig
> and the TurnCustomizer will be invoked by TurnPort before sending
> message. This allows user to e.g add custom attributes as described
> in rtf5389.
> 
> BUG=webrtc:8313
> 
> Change-Id: Ibf5cc10af84c57288f1eb4c578ca064611a769f1
> Reviewed-on: https://webrtc-review.googlesource.com/4781
> Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20197}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,jonaso@webrtc.org

Change-Id: I624efb22f6e3ceac1b2ff8af1ec47e4cfdde9140
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8313
Reviewed-on: https://webrtc-review.googlesource.com/7680
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20199}
2017-10-09 09:53:59 +00:00
Jonas Oreland
b23ed7f1af TurnCustomizer - an interface for modifying stun messages sent by TurnPort
This patch adds an interface that allows modification of stun messages
sent by TurnPort. A user can inject a TurnCustomizer on the RTCConfig
and the TurnCustomizer will be invoked by TurnPort before sending
message. This allows user to e.g add custom attributes as described
in rtf5389.

BUG=webrtc:8313

Change-Id: Ibf5cc10af84c57288f1eb4c578ca064611a769f1
Reviewed-on: https://webrtc-review.googlesource.com/4781
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20197}
2017-10-09 06:35:40 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

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


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

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

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/p2p/base/port_unittest.cc (Browse further)