Commit Graph

752 Commits

Author SHA1 Message Date
870bca1f41 Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
to report the metrics in pc/ and p2p/ that are currently been reported
using MetricsObserverInterface.

TBR=tommi@webrtc.org

Bug: webrtc:9409
Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
Reviewed-on: https://webrtc-review.googlesource.com/83782
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23914}
2018-07-10 20:02:16 +00:00
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
0ea751539e Fix a bug in TurnServer that causes flakiness in webrtc_perf_tests.
When a TCP TURN port is destroyed, a TURN refresh request with zero
lifetime is first sent to release the TURN allocation at the server,
and the underlying TCP connection is closed afterwards.

The closing of the TCP connection is handled first by the
VirtualSocketServer in our test infrastructure, and the corresponding
server socket is asynchronously destroyed at the TURN server. The
refresh request is however still passed to this server socket and
further signaled to the TURN server, which fails a DCHECK. The
server implementation should disable any firing of signals from a
server socket to be destroyed.

The bug id is set to None since this is a one-liner CL.

TBR=pthatcher@webrtc.org

Bug: None
Change-Id: Ib457b3800511a322ef69d67c71f2de05f3d67967
Reviewed-on: https://webrtc-review.googlesource.com/86501
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23809}
2018-07-02 18:51:23 +00:00
dc99e244ca Removing deadbeef@ from OWNERS files.
Since I'm leaving Google.

Bug: None
Notry: True
Change-Id: Ibb5c3e09fce007d149200dcb6cac74be53084764
Reviewed-on: https://webrtc-review.googlesource.com/86461
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23795}
2018-07-02 00:40:38 +00:00
b3f5aed433 Remove the flag PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS.
We now always enable any address ports, only using them if they end up
using interfaces that weren't otherwise accessible. This flag is no
longer used by downstream projects.

TBR=deadbeef@webrtc.org

Bug: None
Change-Id: I6e4e93958cbc4300811bafb103f1a2e8732274ed
Reviewed-on: https://webrtc-review.googlesource.com/85860
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23751}
2018-06-27 00:43:09 +00:00
ac5bbd940e Reland "Enable any address ports by default."
This reverts commit 056a68da896d9a578b9ea83e56d261648ea0adc6.

Reason for revert: Trying to reland.

Original change's description:
> Revert "Enable any address ports by default."
> 
> This reverts commit f04148c810aad2a0809dc8978650c55308381c47.
> 
> Reason for revert: Speculative revert. I suspect this is breaking a
> downstream test (I'll reland if it is not the culprit).
> 
> Original change's description:
> > Enable any address ports by default.
> > 
> > Ports not bound to any specific network interface are allocated by
> > default. These any address ports are pruned after allocation,
> > conditional on the allocation results of normal ports that are bound to
> > the enumerated interfaces.
> > 
> > Bug: webrtc:9313
> > Change-Id: I3ce12eeab0cf3547224e5f8c188d061fc530e145
> > Reviewed-on: https://webrtc-review.googlesource.com/78383
> > Commit-Queue: Qingsi Wang <qingsi@google.com>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23673}
> 
> TBR=deadbeef@webrtc.org,pthatcher@webrtc.org,qingsi@google.com
> 
> Change-Id: I3b3dc42c7de46d198d4b9c270020dcf1100dd907
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9313
> Reviewed-on: https://webrtc-review.googlesource.com/84300
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23678}

TBR=deadbeef@webrtc.org,mbonadei@webrtc.org,pthatcher@webrtc.org,qingsi@google.com

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

Bug: webrtc:9313
Change-Id: I98442346babb5d8953d37dc5825efaf79804ed7f
Reviewed-on: https://webrtc-review.googlesource.com/85000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23720}
2018-06-22 17:27:34 +00:00
0a1d189e50 Replace rtc::Optional with absl::optional in rtc_base
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameter 'rtc_base'
Then manually fix where Optional was used without rtc prefix (patchset#3)

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: I825f80cc8089747876ba6316d9e7c30e05716974
Reviewed-on: https://webrtc-review.googlesource.com/84585
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23700}
2018-06-21 11:23:40 +00:00
5b8dd4d75e Fix a dangling-pointer bug in P2PTransportChannel unit tests.
Messages posted to the main thread are handled by dangling pointers to
destroyed endpoints after the tests end.

Bug: None
Change-Id: I901d63bf11574882d0259cd4b07e628f6a4eebc5
Reviewed-on: https://webrtc-review.googlesource.com/84540
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23691}
2018-06-20 22:25:00 +00:00
056a68da89 Revert "Enable any address ports by default."
This reverts commit f04148c810aad2a0809dc8978650c55308381c47.

Reason for revert: Speculative revert. I suspect this is breaking a
downstream test (I'll reland if it is not the culprit).

Original change's description:
> Enable any address ports by default.
> 
> Ports not bound to any specific network interface are allocated by
> default. These any address ports are pruned after allocation,
> conditional on the allocation results of normal ports that are bound to
> the enumerated interfaces.
> 
> Bug: webrtc:9313
> Change-Id: I3ce12eeab0cf3547224e5f8c188d061fc530e145
> Reviewed-on: https://webrtc-review.googlesource.com/78383
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23673}

TBR=deadbeef@webrtc.org,pthatcher@webrtc.org,qingsi@google.com

Change-Id: I3b3dc42c7de46d198d4b9c270020dcf1100dd907
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9313
Reviewed-on: https://webrtc-review.googlesource.com/84300
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23678}
2018-06-20 07:53:30 +00:00
f04148c810 Enable any address ports by default.
Ports not bound to any specific network interface are allocated by
default. These any address ports are pruned after allocation,
conditional on the allocation results of normal ports that are bound to
the enumerated interfaces.

Bug: webrtc:9313
Change-Id: I3ce12eeab0cf3547224e5f8c188d061fc530e145
Reviewed-on: https://webrtc-review.googlesource.com/78383
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23673}
2018-06-20 04:22:23 +00:00
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
15ac52109f Removing unused cricket::Port constructor.
Has an extra IPAddress argument that's not used at all.

TBR=qingsi@webrtc.org

Bug: None
Change-Id: If516045ab3d4edf4ac9c394dab52b3243db276ad
Reviewed-on: https://webrtc-review.googlesource.com/84061
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23646}
2018-06-18 21:55:04 +00:00
6bbeb080b8 Extract rtc_base/base64.h and rtc_base/base64.cc into separate target.
Extract rtc_base/base64.h and rtc_base/base64.cc into separate target
to prepare to move them into third_party

Bug: webrtc:8366
Change-Id: I477e6da2b9d09307439b3272261f31042f479d74
Reviewed-on: https://webrtc-review.googlesource.com/83980
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23645}
2018-06-18 16:44:47 +00:00
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
1b36894f06 Reland "Refactor the regathering of candidates in P2PTransportChannel."
This is a reland of 14f8aba9967ac2f1789ede12ff66107962757fb5

Original change's description:
> Refactor the regathering of candidates in P2PTransportChannel.
> 
> The functionality of regathering candidates is refactored to a separate
> regathering controller owned by P2PTransportChannel. This refactoring
> is part of a long-term plan to restructure a modularied
> P2PTransportChannel and it would also benefit the addition of autonomous
> regathering of candidates that is proactive to the ICE states in the
> near future.
> 
> Bug: None
> Change-Id: I74cea974ea628430c77b5d51b7c9179ddffc690d
> Reviewed-on: https://webrtc-review.googlesource.com/75820
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23588}

Bug: None
Change-Id: I7308e2aef692edd4f0bf9717a88ba2dfba4383a6
Reviewed-on: https://webrtc-review.googlesource.com/83360
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23607}
2018-06-14 01:40:45 +00:00
5d16d7fd52 Add a DCHECK for null port in FakePortAllocator.
If the socket server of the thread where FakePortAllocator lives is not
configured to be a VirtualSocketServer, there is a chance that we have a
null port in FakePortAllocator::StartGettingPort after creating the test
UDP port (for example, no permission to create a real socket if using a
PhysicalSocketServer), and subsequently this results in a crash when
connecting a signal in the port to a slot.

Bug: webrtc:9406
Change-Id: I1ba4526f7b9e104bed556f61d9348edc426fc1fc
Reviewed-on: https://webrtc-review.googlesource.com/83480
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23606}
2018-06-14 00:37:15 +00:00
1f4d7a2848 Revert "Refactor the regathering of candidates in P2PTransportChannel."
This reverts commit 14f8aba9967ac2f1789ede12ff66107962757fb5.

Reason for revert: breaking internal tests

Original change's description:
> Refactor the regathering of candidates in P2PTransportChannel.
> 
> The functionality of regathering candidates is refactored to a separate
> regathering controller owned by P2PTransportChannel. This refactoring
> is part of a long-term plan to restructure a modularied
> P2PTransportChannel and it would also benefit the addition of autonomous
> regathering of candidates that is proactive to the ICE states in the
> near future.
> 
> Bug: None
> Change-Id: I74cea974ea628430c77b5d51b7c9179ddffc690d
> Reviewed-on: https://webrtc-review.googlesource.com/75820
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23588}

TBR=deadbeef@webrtc.org,pthatcher@webrtc.org,qingsi@google.com

Change-Id: I8b08351c9a3fcf89e2a25ed2c668c335cbd2d2d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/83300
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23592}
2018-06-13 05:55:45 +00:00
241d0c16c0 Remove ContinualGatheringPolicy::GATHER_CONTINUALLY_AND_RECOVER.
This policy is not implemented.

Bug: None
Change-Id: I6c162d61c2488a4726c20df5c14439f83633a198
Reviewed-on: https://webrtc-review.googlesource.com/76041
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23591}
2018-06-13 01:00:00 +00:00
aed7164bde Updated PeerConnection integration test to fix race condition.
The PeerConnection integration test was creating TurnServers on the
stack on the signaling thread. This could cause a race condition problem
when the test was being taken down. Since the turn server was destructed
on the signaling thread, a socket might still try and send to it after
it was destroyed causing a seg fault. This change creates/destroys the
TestTurnServers on the network thread to fix this issue.

Bug: None
Change-Id: I080098502b737f0972ce2fa5357920de057a3312
Reviewed-on: https://webrtc-review.googlesource.com/81301
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23590}
2018-06-13 00:20:10 +00:00
14f8aba996 Refactor the regathering of candidates in P2PTransportChannel.
The functionality of regathering candidates is refactored to a separate
regathering controller owned by P2PTransportChannel. This refactoring
is part of a long-term plan to restructure a modularied
P2PTransportChannel and it would also benefit the addition of autonomous
regathering of candidates that is proactive to the ICE states in the
near future.

Bug: None
Change-Id: I74cea974ea628430c77b5d51b7c9179ddffc690d
Reviewed-on: https://webrtc-review.googlesource.com/75820
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23588}
2018-06-12 22:51:40 +00:00
dadaaee3e8 Remove stringstreams from p2p/
Bug: webrtc:8982
Change-Id: Ibb01bbb7e5f07d266ac7dff45932afe95abc761c
Reviewed-on: https://webrtc-review.googlesource.com/82801
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23576}
2018-06-12 08:08:57 +00:00
20e8cfb341 Fixing bug with PseudoTcp that corrupts data if initial packet is lost.
The issue occurred if a control segment is received after a non-control
segment received out-of-order, which only happens if:
* The initial "connect" segment is lost, and retransmitted later.
* Both sides send "connect"s simultaneously (rather than having
  designated server/client roles), such that the local side thinks a
  connection is established even before its "connect" has been
  acknowledged.
* Nagle algorithm disabled, allowing a data segment to be sent before
  the "connect" has been acknowledged.

This may seem like a pretty specific set of circumstances, but it can
happen with chromoting.

See the linked bug for more details.

Bug: webrtc:9208
Change-Id: I3cfe26e02158fcc5843f32d4e2ef7c511d58d9c9
Reviewed-on: https://webrtc-review.googlesource.com/78861
Reviewed-by: Sergey Ulanov <sergeyu@google.com>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23477}
2018-05-31 18:54:58 +00:00
59b4e3ea8c Split IceCandidatePairEventType enum.
Disjoint subsets of the enum values are used for Ice candidate config
events and Ice candidate check events. This CL breaks out the config
part to a separate enum and by extension changes the icelogger interface
for config events.

Bug: webrtc:9336, webrtc:8111
Change-Id: I405b5c3981905c3c504b45afdddb3649469ed141
Reviewed-on: https://webrtc-review.googlesource.com/79943
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23464}
2018-05-31 08:42:10 +00:00
434327376b Don't assume that RTC_LOG's << operator is std::ostream
Bug: webrtc:8982, webrtc:9185
Change-Id: I8a88c10725508f7ea8a7f46e8bcdac4afdb2c617
Reviewed-on: https://webrtc-review.googlesource.com/77681
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23359}
2018-05-23 10:07:20 +00:00
65ec0fc81e Delete unneeded includes of basictypes.h.
This is a kitchen-sink header, some pieces should be moved to
byteorder.h, the rest likely deleted.

Delete most includes of basictypes.h. In leaf headers,
include stddef.h and stdint.h explicitly where needed.

Bug: webrtc:6853
Change-Id: Ibc809936a8f94d418e4eb650da1e89c1b9142073
Reviewed-on: https://webrtc-review.googlesource.com/77721
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23333}
2018-05-21 19:35:08 +00:00
a832019f4e Add qingsi@ as owner of p2p.
Bug: None
Change-Id: Iffcb6eb665b5f4a909f2dcf52471cb57919823c5
Reviewed-on: https://webrtc-review.googlesource.com/77843
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23315}
2018-05-18 21:31:56 +00:00
502db3df4e Replace MessageHandler by AsyncInvoker in P2PTransportChannel.
The existing asynchronous task execution in P2PTransportChannel is
implemented by posting messages to its network thread (a rtc::Thread)
and consuming these messages as a MessageHandler. The readability of
the implementation can be improved by using AsyncInvoker, which is
exactly designed for this scenario.

Bug: None
Change-Id: Ibee830d0d2bc19fc1ca5b894f194d9b69c40eef4
Reviewed-on: https://webrtc-review.googlesource.com/74642
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23267}
2018-05-17 01:05:31 +00:00
10a0e516bf Improve text logs in the network stack.
1) Network info is appended with its network ID assigned by the network
manager so that we can cross-reference networks by IDs in the log.
2) The local network info is added to the candidate pair string
representation so that we do not need the cross reference to the
logs of candidate gathering to find out the network where the local
candidate is from.
3) A flag is added to the candidate pair string representation to
indicate if this pair is the selected one.
4) Sorting of candidate pairs is logged with the reason of sorting
request.
5) Network filtering that takes place in the port allocator is
explicitly logged.

Bug: None
Change-Id: Iaa337394cad803515e26e254814aa04ed2213eab
Reviewed-on: https://webrtc-review.googlesource.com/72522
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23266}
2018-05-16 23:46:22 +00:00
7f0a069550 Reduce log level for socket.SetOptions() to LS_INFO
Bug: webrtc:9221
Change-Id: I7bbbece754afa4e02ab000ee33e2b09ead5647a1
Reviewed-on: https://webrtc-review.googlesource.com/73686
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23197}
2018-05-10 06:40:41 +00:00
e53ac0463d Add Ethernet and loopback entries to GetAdapterTypeFromName.
GetAdapterTypeFromName determines the adapter type of a network
interface based on the string matching of the interface name. It however
does not have an entry to map the well-known "eth" name to the common
Ethernet type. This introduces subtle bugs when GetAdapterTypeFromName
is used as the only method to determine a network type and Ethernet is
thus identified as an unknown network, which affects the network
filtering and network path selection that rely on the network type.

Bug: webrtc:9235
Change-Id: Ifc3269d191382f3b3a041de1c9755c09994b31b2
Reviewed-on: https://webrtc-review.googlesource.com/74263
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23195}
2018-05-10 00:18:11 +00:00
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
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
31e5bf59e0 Remove deprecated SocketFactory overrides.
Bug: webrtc:9198
Change-Id: I0ec3e4120e936fefa76e6cef968d7f615f568aa8
Reviewed-on: https://webrtc-review.googlesource.com/73964
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23156}
2018-05-07 20:03:27 +00:00
f82644c9c7 Change the receiving state update rule.
The existing rule regards a candidate pair as not receiving if it does
not receive any data packet, connectivity check, or connectivity check
response for a timeout period since the last receipt of any packet
above. A backup candidate pair typically sends connectivity checks at a
slow pace to preserve the battery life, and the existing rule however
declares receiving timeout for backup candidate pairs as a side effect.
This is a result of the conflicting value of the receiving timeout
period and the longer default connectivity check interval for backup
candidate pairs.

The new rule regards any candidate pair that has its last connectivity
check acknowledged by a response as receiving.

Bug: webrtc:9145
Change-Id: Ie0171fd83aca3d6a0a465885be32f0854856be7f
Reviewed-on: https://webrtc-review.googlesource.com/69784
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22892}
2018-04-17 01:00:02 +00:00
a2d60679c9 Reland "Add thread checker to PortAllocator and its subclasses and fix a bug causing memory contention by threads."
This is a reland of fc43d11717e16dd427ac84fee614e5511e43cefd

Original change's description:
> Add thread checker to PortAllocator and its subclasses and fix a bug
> causing memory contention by threads.
>
> PortAllocator and its subclasses assume all of their methods except the
> constructor must be called on the same thread (the network thread in
> practice). This CL adds a thread checker to PortAllocator and its
> subclasses for thread safety, and fixes bugs of invoking some of their
> methods in PeerConnection on the signaling thread.
>
> Bug: webrtc:9112
> Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
> Reviewed-on: https://webrtc-review.googlesource.com/66945
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22814}

Bug: webrtc:9112
Change-Id: I5c7377f05c0daccbe469e2fdbdfacabc5c222f4c
Reviewed-on: https://webrtc-review.googlesource.com/69422
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22889}
2018-04-16 21:44:28 +00:00
c4384ea138 Remove PORTALLOCATOR_ENABLE_SHARED_UFRAG
This flag is unused.

Bug: None
Change-Id: I1ad52feca1db8e669f4e7c7c5b45a4cb245c1c55
Reviewed-on: https://webrtc-review.googlesource.com/69780
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22865}
2018-04-13 19:16:48 +00:00
6e641e64b2 Signal detailed packet info for each packet sent.
Per-packet info is now signaled in SentPacket to provide useful stats
for bandwidth consumption and overhead analysis in the network stack.

Bug: webrtc:9103
Change-Id: I2b8f6491567d0fa54cc559fc5a96d7aac7d9565e
Reviewed-on: https://webrtc-review.googlesource.com/66281
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22834}
2018-04-12 04:46:06 +00:00
3dc41069ef Revert "Add thread checker to PortAllocator and its subclasses and fix a bug"
This reverts commit fc43d11717e16dd427ac84fee614e5511e43cefd.

Reason for revert: Crashes downstream tests

Original change's description:
> Add thread checker to PortAllocator and its subclasses and fix a bug
> causing memory contention by threads.
> 
> PortAllocator and its subclasses assume all of their methods except the
> constructor must be called on the same thread (the network thread in
> practice). This CL adds a thread checker to PortAllocator and its
> subclasses for thread safety, and fixes bugs of invoking some of their
> methods in PeerConnection on the signaling thread.
> 
> Bug: webrtc:9112
> Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
> Reviewed-on: https://webrtc-review.googlesource.com/66945
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22814}

TBR=deadbeef@webrtc.org,pthatcher@google.com,pthatcher@webrtc.org,qingsi@google.com,honghaiz@webrtc.org

Change-Id: I2db6561d5d6366d38caa58c3e719d0d48eda70c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9112
Reviewed-on: https://webrtc-review.googlesource.com/69200
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22818}
2018-04-11 11:15:08 +00:00
fc43d11717 Add thread checker to PortAllocator and its subclasses and fix a bug
causing memory contention by threads.

PortAllocator and its subclasses assume all of their methods except the
constructor must be called on the same thread (the network thread in
practice). This CL adds a thread checker to PortAllocator and its
subclasses for thread safety, and fixes bugs of invoking some of their
methods in PeerConnection on the signaling thread.

Bug: webrtc:9112
Change-Id: I33ba9bae72ec09a45ec70435962f3f25cd31583c
Reviewed-on: https://webrtc-review.googlesource.com/66945
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22814}
2018-04-11 00:06:40 +00:00
fd350d74ee By default, don't use SRTP_AES128_CM_SHA1_32 protection profile.
This profile will now not be used unless the application explicitly
sets the flag in CryptoOptions to true. As a result, an 80-bit
authentication tag will be used instead of a 32-bit one. See bug for
more details.

Bug: webrtc:7670
Change-Id: I7c0a118fd7b1e7aac23b9eb8717099f055de0441
Reviewed-on: https://webrtc-review.googlesource.com/66600
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22757}
2018-04-05 23:43:07 +00:00
8487988b28 Remove myself from some owners files. Fix order in those files. Replace myself in comment references.
Bug: None
Change-Id: I25dba5d9ec3ab073655c01a838b57ce74797e4e6
Reviewed-on: https://webrtc-review.googlesource.com/64445
Commit-Queue: Henrik Grunell <henrikg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22708}
2018-04-03 14:07:31 +00:00
abbe841721 This CL removes all usages of our custom ostream << overloads.
This prepares us for removing them altogether.

Bug: webrtc:8982
Change-Id: I66002cc8d4bf0e07925766d568d2498422f0f38e
Reviewed-on: https://webrtc-review.googlesource.com/64142
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22707}
2018-04-03 12:51:00 +00:00
d7d762d08d Remove LOG_J and LOG_JV, tweak p2p logs.
Bug: webrtc:9077
Change-Id: I54ecf10592add33692fc6e694c2f10a646e81345
Reviewed-on: https://webrtc-review.googlesource.com/56142
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22667}
2018-03-29 08:21:27 +00:00
c99dc31501 Add ability to release TURN allocation gracefully
This patch adds TurnPort::Release that release a TURN allocation
by sending a REFRESH with lifetime 0 without destroying the object.

This allows for graceful shutdown of a TurnPort that can e.g be used
for mobility.

Bug: webtrc:9067
Change-Id: I1e4d9232ae08d6fe14f5612f776a541c03c3beec
Reviewed-on: https://webrtc-review.googlesource.com/64722
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22666}
2018-03-29 06:17:47 +00:00
dea6889ef6 Add sanity checks of IceConfig parameters.
IceConfig contains a set of parameters that affect the behavior of ICE.
Inconsistent or conflicting parameters lead to erroneous or
unpredicatble behavior in the network stack. Sanity checks are now added
to validate IceConfig.

TBR=magjed@webrtc.org

Bug: webrtc:8993
Change-Id: I708bc3f1ef970872754a82a47a509bda15061ca6
Reviewed-on: https://webrtc-review.googlesource.com/60847
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22664}
2018-03-28 22:09:57 +00:00
16ccef7f11 Allow implementation defined STUN attributes in 0x4000-0x7FFF range
This patch modifies StunMessage to allow adding of attributes
in the 0x4000-0x7FFF range without adding them to stun.cc.

Before this patch this was allowed in the 0xC000-0xFFFF range
but the RFC specifies that both of these ranges are implementation
defined.

BUG=webrtc:8313

Change-Id: Ib74f5d02a06807aeca4fc3f1f3028271e233f004
Reviewed-on: https://webrtc-review.googlesource.com/64404
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22619}
2018-03-27 08:26:31 +00:00
2bd41f9e0e Fix a bug caused by an early return when a TURN port receives a role
conflict.


A role conflict received from an unknown address (peer reflexive
candidate) results in an early return before signaling the unknown
address to P2PTransportChannel. Without this signal, there is no
candidate pair or TURN entry created, and sending the error response
when handling the role conflict fails.

Bug: webrtc:9034
Change-Id: I0f1b232a574449e98025618d93aac8a91b30e14b
Reviewed-on: https://webrtc-review.googlesource.com/63840
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22588}
2018-03-23 22:42:15 +00:00
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
2c8773b2bd Avoid DCHECK in P2PTransportChannel::MorePingable.
Some implementations of std::max_element (used to find the "most
pingable" connection) seem to compare an element with itself, which
MorePingable doesn't handle.

Fixing by handling the self-comparison outside MorePingable.

Bug: webrtc:8697
Change-Id: Ieb34580f52037639c00041a4e65901cad92d0971
Reviewed-on: https://webrtc-review.googlesource.com/62402
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22543}
2018-03-21 18:16:48 +00:00
01cb5f2cee Fix issue where sockets bound to temporary IPv6 addresses are discarded.
Also removing the implicit InterfaceAddress constructor that takes an
IPAddress, so that issues like this won't happen in the future.

And adding a convenience "Network::AddIP" method that takes an
IPAddress, so that code doing that (previously relying on the implicit
constructor) will continue to work.

Bug: webrtc:8972
Change-Id: Id5cf0fca481cfee3f8ab83412fcb41886535bba2
Reviewed-on: https://webrtc-review.googlesource.com/59461
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22504}
2018-03-19 19:22:31 +00:00