All downstream code have been updated to the new location.
In PRESUBMIT.py:
* Remove webrtc/rtc_base from CPP_BLACKLIST
* Add webrtc/rtc_base to LEGACY_API_DIRS
Fix some duplicated paths in
webrtc/modules/audio_processing/test/conversational_speech/BUILD.gn
BUG=webrtc:7634
TBR=kwiberg@webrtc.org
Review-Url: https://codereview.webrtc.org/2976293002
Cr-Commit-Position: refs/heads/master@{#19094}
Reason for revert:
Seems to be causing new crashes, possibly because of changes to the "Destroy(false)" behavior. Will re-land after investigating these crashes more and addressing the root cause.
Original issue's description:
> Delete SignalThread class.
>
> Rewrite AsyncResolver to use PlatformThread directly, not
> SignalThread, and update includes of peerconnection client to not
> depend on signalthread.h.
>
> BUG=webrtc:6424,webrtc:7723
>
> Review-Url: https://codereview.webrtc.org/2915253002
> Cr-Commit-Position: refs/heads/master@{#18833}
> Committed: bc8feda1dbTBR=tommi@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org
NOPRESUBMIT=true
NOTRY=true
BUG=webrtc:6424,webrtc:7723
Review-Url: https://codereview.webrtc.org/2979733002
Cr-Commit-Position: refs/heads/master@{#18980}
All downstream code have been updated to the new location.
In PRESUBMIT.py:
* Remove webrtc/rtc_base from CPP_BLACKLIST
* Add webrtc/rtc_base to LEGACY_API_DIRS
Fix some duplicated paths in
webrtc/modules/audio_processing/test/conversational_speech/BUILD.gn
BUG=webrtc:7634
TBR=kwiberg@webrtc.org
Review-Url: https://codereview.webrtc.org/2973183002
Cr-Commit-Position: refs/heads/master@{#18948}
Rewrite AsyncResolver to use PlatformThread directly, not
SignalThread, and update includes of peerconnection client to not
depend on signalthread.h.
BUG=webrtc:6424,webrtc:7723
Review-Url: https://codereview.webrtc.org/2915253002
Cr-Commit-Position: refs/heads/master@{#18833}
Reland the base->rtc_base without adding stub headers (will be
done in follow-up CL). This preserves git blame history of all files.
BUG=webrtc:7634
NOTRY=True
TBR=kwiberg@webrtc.org
Change-Id: Iea3bb6f3f67b8374c96337b63e8f5aa3e6181012
Reviewed-on: https://chromium-review.googlesource.com/554611
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18821}
Will reland in two different commits to preserve git blame history.
BUG=webrtc:7634
NOTRY=True
TBR=kwiberg@webrtc.org
Change-Id: I550da8525aeb9c5b8f96338fcf1c9714f3dcdab1
Reviewed-on: https://chromium-review.googlesource.com/554610
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18820}
This refactoring takes a careful approach to avoid rushing the change:
* stub headers are left in all the old locations of webrtc/base
* existing GN targets are kept and now just forward to the moved ones
using public_deps.
The only exception to the above is the base_java target and its .java files,
which were moved to webrtc/rtc_base right away since it's not possible
to use public_deps for android_library.
To avoid breaking builds, a temporary Dummy.java file was added to
the new intermediate target in webrtc/rtc_base:base_java as well to avoid
hitting a GN assert in the android_library template.
The above approach should make the transition smooth without breaking
downstream.
A helper script was created (https://codereview.webrtc.org/2879203002/)
and was run like this:
stub-headers.py -s webrtc/base -d webrtc/rtc_base -i 7634
stub-headers.py -s webrtc/base/numerics -d webrtc/rtc_base/numerics -i 7634
Fixed invalid header guards in the following files:
webrtc/base/base64.h
webrtc/base/cryptstring.h
webrtc/base/event.h
webrtc/base/flags.h
webrtc/base/httpbase.h
webrtc/base/httpcommon-inl.h
webrtc/base/httpcommon.h
webrtc/base/httpserver.h
webrtc/base/logsinks.h
webrtc/base/macutils.h
webrtc/base/nattypes.h
webrtc/base/openssladapter.h
webrtc/base/opensslstreamadapter.h
webrtc/base/pathutils.h
webrtc/base/physicalsocketserver.h
webrtc/base/proxyinfo.h
webrtc/base/sigslot.h
webrtc/base/sigslotrepeater.h
webrtc/base/socket.h
webrtc/base/socketaddresspair.h
webrtc/base/socketfactory.h
webrtc/base/stringutils.h
webrtc/base/testbase64.h
webrtc/base/testutils.h
webrtc/base/transformadapter.h
webrtc/base/win32filesystem.h
Added new header guards to:
sslroots.h
testbase64.h
BUG=webrtc:7634
NOTRY=True
NOPRESUBMIT=True
R=kwiberg@webrtc.org
Review-Url: https://codereview.webrtc.org/2877023002 .
Cr-Commit-Position: refs/heads/master@{#18816}
Having members in a class which only exist when certain compliation flags are turned on (unless relating to the target platform) means that those flags must be the same when compiling the module as when including its headers from other modules. This means that code outside of WebRTC runs the risk of misjudging the size of an rtc::CriticalSection, or any class which has an rtc::CriticalSection as a member. (This rule is applied recursively.) If a mismatch occurs, memory corruption is likely.
Having discussed this a bit, we have decided that the simplest solution is probably the best - always define those members, even when compilation flags (namely, CS_DEBUG_CHECKS) render it unused.
BUG=webrtc:7867
Review-Url: https://codereview.webrtc.org/2957753002
Cr-Commit-Position: refs/heads/master@{#18811}
It allows to use rtc::Buffer in templates that expect std container,
e.g. it can now be used as ::testing::ElementsAreArray parameter
Bug: None
Change-Id: I97d7ffb13393d02850ddb213f7a1d01129b10b05
Reviewed-on: https://chromium-review.googlesource.com/539635
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18809}
For consistency with SafeMin(), SafeMax(), and SafeClamp(). And so that we avoid introducing a namespace.
BUG=webrtc:7459
Review-Url: https://codereview.webrtc.org/2802423002
Cr-Commit-Position: refs/heads/master@{#18756}
These methods have the same behavior as their counterparts in std::optional, except that rtc::Optional::value() requires that the value exists whereas std::optional::value() throws an exception.
BUG=webrtc:7843
Review-Url: https://codereview.webrtc.org/2942203002
Cr-Commit-Position: refs/heads/master@{#18631}
This CL adds the flag "PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS", which will
force the creation of ports not bound to any specific network interface.
These are normally only used when network enumeration fails or is disabled,
but in some circumstances (such as the one the test case adds), they're the
only thing that works.
This will result in extra ports being gathered, which is why it's only enabled
behind a flag for now. In the future, we could probably introduce more
sophisticated "pruning" logic that would lessen the impact of the extra ports
when they're redundant, and make the flag the default.
Some other minor changes that were required to make this use case work:
* Allow a TCPPort to be used for outgoing connections even if it tries and
fails to create a server socket.
* Allow Bind to fail if being called before Connect, and the IP is an "any"
address (0.0.0.0 or ::), since this bind would have been mostly pointless
anyway.
* Prevent P2PTransprotChannel from keeping a "backup" candidate pair using
an "any address" network; we only want this for actual networks.
BUG=webrtc:7798
Review-Url: https://codereview.webrtc.org/2936553003
Cr-Commit-Position: refs/heads/master@{#18578}
Since this is a test for a fake network, it's only natural that it uses
a fake clock as well. This makes the tests much faster, less flaky, and
lets them be moved out of "webrtc_nonparallel_tests", since they no
longer have a dependency on any "real" thing (sockets, or time) and
can be run in parallel as easily as any other tests.
As part of this CL, added the fake clock as an argument to
VirtualSocketServer's and TestClient's constructors, since these classes
have methods that wait synchronously for something to occur, and if the
test is using a fake clock, they need to advance it in order to make
progress.
Lastly, added a DCHECK in Thread::ProcessMessages. If called with a
nonzero time while a fake clock is used, it will get stuck in an
infinite loop; a DCHECK is easier to notice than an infinite loop.
BUG=webrtc:7727, webrtc:2409
Review-Url: https://codereview.webrtc.org/2927413002
Cr-Commit-Position: refs/heads/master@{#18544}
Specifically, just like SafeMin() and SafeMax() it handles all
combinations of integer and all
combinations of floating-point arguments by picking a
result type that is guaranteed to be able to hold the result.
This CL also replaces a bunch of std::min + std:max call pairs with
calls to SafeClamp()---the ones that could easily be found by grep
because "min" and "max" were on the same line. :-)
BUG=webrtc:7459
Review-Url: https://codereview.webrtc.org/2808513003
Cr-Commit-Position: refs/heads/master@{#18542}
This is to make it possible to override the rtc_task_queue target only.
BUG=none
Review-Url: https://codereview.webrtc.org/2931273002
Cr-Commit-Position: refs/heads/master@{#18534}
After landing https://chromium-review.googlesource.com/528173
only one test needs to be disabled: VirtualSocketServerTest.delay_v4
BUG=webrtc:7727
NOTRY=True
TESTED=gn gen out/x64-Debug --args='target_os="ios" ios_enable_code_signing=false is_component_build=false target_cpu="x64"'
ninja -C out/x64-Debug webrtc_nonparallel_tests
out/x64-Debug/iossim -d "iPhone 6s" -s 10.3 out/x64-Debug/webrtc_nonparallel_tests.app
Review-Url: https://codereview.webrtc.org/2909073002
Cr-Commit-Position: refs/heads/master@{#18519}
Fix issue where running tests on iOS would get killed after a certain
time had passed. This seems to be due to springboard killing apps
that don't have a GUI running. Creating a UIApplication to wrap
the test suite seems to solve this problem in chromium.
This CL adds a class for this purpose. Most of the code was copied
from chromium with bits taken out.
Bug: webrtc:7161, webrtc:7758
Change-Id: I10f9bc8914e73f2870a9b0a2703cde496af8db2f
Reviewed-on: https://chromium-review.googlesource.com/528173
Reviewed-by: Henrik Andreasson <henrika@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Kári Tristan Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18509}
One of our toolchains does not expose |errno| in the global namespace.
BUG=none
Review-Url: https://codereview.webrtc.org/2926273002
Cr-Commit-Position: refs/heads/master@{#18506}
This build target was used by webrtc/base:webrtc_base which is not a
build target anymore. Instead we have webrtc/base:rtc_base which depends
directly on third_party/boringssl.
BUG=None
NOTRY=True
Review-Url: https://codereview.webrtc.org/2926703003
Cr-Commit-Position: refs/heads/master@{#18472}
BoringSSL (or OpenSSL) require that when SSL_write fails due to the
underlying socket being blocked, it's retried with the same parameters
until it succeeds. But we weren't doing this, and our socket
abstraction doesn't have an equivalent requirement. So when this was
occurring, we would just end up trying to send the next RTP or STUN
packet (instead of the packet that couldn't be sent), and BoringSSL
doesn't like that.
So, when this condition occurs now, we'll simply enter a "pending write"
mode and buffer the data that couldn't be completely sent. When the
underlying socket becomes writable again, or if Send is called again
before that happens, we retry sending the buffered data. Making both
BoringSSL and the upper layer of code that expects normal TCP socket
behavior happy.
Also adding some more logging, and fixing an issue with VirtualSocketServer
that made it behave slightly differently than PhysicalSocketServer when a
TCP packet is only partially read.
BUG=webrtc:7753
Review-Url: https://codereview.webrtc.org/2915243002
Cr-Commit-Position: refs/heads/master@{#18416}
Only will be used if WEBRTC_POSIX and WEBRTC_LINUX are both defined and
"epoll_create" doesn't return an error. Otherwise the default "select"-based
IO loop will be used.
BUG=webrtc:7585
Review-Url: https://codereview.webrtc.org/2880923002
Cr-Commit-Position: refs/heads/master@{#18359}
This can occur (and by default, terminates the process) for apps that
don't use the "voip" UIBackgroundMode.
We're already doing a similar thing on Linux (using MSG_NOSIGNAL for every
packet sent).
BUG=webrtc:7686
Review-Url: https://codereview.webrtc.org/2903313002
Cr-Commit-Position: refs/heads/master@{#18277}
The change is now compatible with the old JVM::Initialize API. The
context is passed to the ContextUtils class when calling its deprecated
signature.
BUG=webrtc:7665
NOTRY=True # Only comment changes since the last patchset.
Review-Url: https://codereview.webrtc.org/2903253004
Cr-Commit-Position: refs/heads/master@{#18268}
Reason for revert:
Causes a new TSan race warning. Will reland after fixing. Note this is the same race as will be fixed by https://codereview.webrtc.org/2876273002/.
Original issue's description:
> Fixing potential AsyncInvoker deadlock that occurs for "reentrant" invocations.
>
> The deadlock occurs if the AsyncInvoker is destroyed on thread A while
> a task on thread B is running, which AsyncInvokes a task back on thread
> A.
>
> This was causing pending_invocations_ to end up negative, because
> an AsyncClosure that's never added to a thread's message queue (due to
> the "destroying_" flag) caused the count to be decremented but not
> incremented.
>
> BUG=None
>
> Review-Url: https://codereview.webrtc.org/2885143006
> Cr-Commit-Position: refs/heads/master@{#18225}
> Committed: ef37ca5fb3TBR=nisse@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None
Review-Url: https://codereview.webrtc.org/2904543003
Cr-Commit-Position: refs/heads/master@{#18248}
The deadlock occurs if the AsyncInvoker is destroyed on thread A while
a task on thread B is running, which AsyncInvokes a task back on thread
A.
This was causing pending_invocations_ to end up negative, because
an AsyncClosure that's never added to a thread's message queue (due to
the "destroying_" flag) caused the count to be decremented but not
incremented.
BUG=None
Review-Url: https://codereview.webrtc.org/2885143006
Cr-Commit-Position: refs/heads/master@{#18225}
External dependencies need to be updated to call ContextUtils.initialize
before rest of the CL can be landed.
BUG=webrtc:7665
Review-Url: https://codereview.webrtc.org/2893933003
Cr-Commit-Position: refs/heads/master@{#18208}
Reason for revert:
Downstream project now fixed.
Original issue's description:
> Revert of Reduce dependencies on rtc::FileSystem in FileRotatingStream tests, adding helpers in webrtc::test:: (patchset #7 id:120001 of https://codereview.webrtc.org/2872283002/ )
>
> Reason for revert:
> Fails to compile successfully.
>
>
> Original issue's description:
> > Reduce dependencies on rtc::FileSystem in FileRotatingStream tests.
> >
> > Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
> > Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
> > to replace use of Filesystem::DeleteFolderAndContents.
> >
> > This makes Filesystem::DeleteFolderAndContents unused, to be deleted
> > together with related code in a followup cl.
> >
> > BUG=webrtc:7345
> >
> > Review-Url: https://codereview.webrtc.org/2872283002
> > Cr-Commit-Position: refs/heads/master@{#18173}
> > Committed: dd7b5f32b5
>
> TBR=pthatcher@webrtc.org,kjellander@webrtc.org,tommi@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7345
>
> Review-Url: https://codereview.webrtc.org/2885393002
> Cr-Commit-Position: refs/heads/master@{#18180}
> Committed: deaa33d2f5TBR=pthatcher@webrtc.org,kjellander@webrtc.org,tommi@webrtc.org,ehmaldonado@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7345
Review-Url: https://codereview.webrtc.org/2885413002
Cr-Commit-Position: refs/heads/master@{#18193}
This is in preparation for "epoll" integration where additional code needs to
run when the enabled events change.
BUG=webrtc:7585
Review-Url: https://codereview.webrtc.org/2893723002
Cr-Commit-Position: refs/heads/master@{#18189}
Reason for revert:
Fails to compile successfully.
Original issue's description:
> Reduce dependencies on rtc::FileSystem in FileRotatingStream tests.
>
> Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
> Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
> to replace use of Filesystem::DeleteFolderAndContents.
>
> This makes Filesystem::DeleteFolderAndContents unused, to be deleted
> together with related code in a followup cl.
>
> BUG=webrtc:7345
>
> Review-Url: https://codereview.webrtc.org/2872283002
> Cr-Commit-Position: refs/heads/master@{#18173}
> Committed: dd7b5f32b5TBR=pthatcher@webrtc.org,kjellander@webrtc.org,tommi@webrtc.org,nisse@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7345
Review-Url: https://codereview.webrtc.org/2885393002
Cr-Commit-Position: refs/heads/master@{#18180}
Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
to replace use of Filesystem::DeleteFolderAndContents.
This makes Filesystem::DeleteFolderAndContents unused, to be deleted
together with related code in a followup cl.
BUG=webrtc:7345
Review-Url: https://codereview.webrtc.org/2872283002
Cr-Commit-Position: refs/heads/master@{#18173}
The only thing the physical socket server was used for was
"Wait"/"WakeUp", but it could be replaced by a simple rtc::Event.
So, removing this dependency makes things less confusing; the fact that
VirtualSocketServer takes a PhysicalSocketServer may lead someone to
think it uses real sockets internally, when it doesn't.
BUG=None
Review-Url: https://codereview.webrtc.org/2883313003
Cr-Commit-Position: refs/heads/master@{#18172}
For every failing test, the solution was either to do a "has IPv4" check
before the test is run, or avoid depending on real network interfaces
altogether.
This specifically fixes rtc_unittests, peerconnection_unittests, and
webrtc_nonparallel_tests.
BUG=None
Review-Url: https://codereview.webrtc.org/2881973002
Cr-Commit-Position: refs/heads/master@{#18155}