When the fake clock's time is advanced, it now ensures all pending
queued messages have been dispatched. This allows us to write a
"SIMULATED_WAIT" macro that ticks the simulated clock by milliseconds up
until the target time.
Useful in this case, where we know the STUN timeout should take a total
of 9500ms, but it would be overly complex to write test code that waits
for each individual timeout, ensures a STUN packet has been
retransmited, etc.
(The test described above *should* be written, but it belongs in
p2ptransportchannel_unittest.cc, not webrtcsession_unittest.cc).
Review-Url: https://codereview.webrtc.org/2024813004
Cr-Commit-Position: refs/heads/master@{#13043}
Using an "EXPECT_WAIT" pattern with a long timeout rather than calling
"SleepMs" with a margin of 250ms.
BUG=webrtc:5953
Review-Url: https://codereview.webrtc.org/2029853002
Cr-Commit-Position: refs/heads/master@{#13040}
Everything except the dependency on
sdk/sdk_tests.gyp:rtc_sdk_peerconnection_objc_tests is included.
That one actually doesn't make those tests run as part of rtc_unittests
(by design). Fixing that + add them will done in aseparate CL.
BUG=webrtc:5949
TESTED=Built and ran rtc_unittests on Mac.
Verified the number of tests matched a run on the bot (1213 tests executed).
R=perkj@webrtc.org
Review URL: https://codereview.webrtc.org/2034923003 .
Cr-Commit-Position: refs/heads/master@{#13036}
The VUI part an SPS may specify max_num_reorder_frames and
max_dec_frame_buffering. These may cause a decoder to buffer a number
of frame prior allowing decode, leading to delays, even if no frames
using such references (ie B-frames) are sent.
Because of this we update any SPS block emitted by the encoder.
Also, a bunch of refactoring of H264-related code to reduce code
duplication.
BUG=
Review-Url: https://codereview.webrtc.org/1979443004
Cr-Commit-Position: refs/heads/master@{#13010}
Move the sources of rtc_unittests and xmllite_xmpp_unittests
into the actual targets instead of depending on none-targets.
This will make it easier to create GN targets matching them.
BUG=webrtc:5949
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/2029583002
Cr-Commit-Position: refs/heads/master@{#13008}
BUG=webrtc:5949
TESTED=Built and ran the tests on Mac.
NOTRY=True
Review-Url: https://codereview.webrtc.org/2025343002
Cr-Commit-Position: refs/heads/master@{#13007}
This will make it much less likely for application developers to not
realize the object is reference counted.
It also fixes a bug in the Java PeerConnection binding, by allowing a
reference to be transferred in the OnRemoveStream call via std::move.
BUG=webrtc:5128
R=pthatcher@webrtc.org, tkchin@webrtc.org
Review URL: https://codereview.webrtc.org/1972793003 .
Cr-Commit-Position: refs/heads/master@{#12976}
This will be useful for any tests that test objects with time-dependent
behavior. It will allow such tests to be written in such a way that their
outcome is more repeatable (less flaky), and will also allow such tests
to finish quicker. For example, a test for STUN timeout doesn't need to
wait the full timeout interval in real time; it can simply advance the
simulated clock.
BUG=webrtc:4925
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1895933003 .
Cr-Commit-Position: refs/heads/master@{#12950}
Lowers risk of the event-tracing thread affecting measurements (and
performance of device). Entirely speculative, but shouldn't hurt.
Timings are still done on the thread that calls the trace macros.
BUG=
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2013363002 .
Cr-Commit-Position: refs/heads/master@{#12943}
This makes it clearer that the C++ SurfaceTextureHelper owns its associated java object it.
In addition, arrange so that the SurfaceTextureHelper.stopListening
method (in java) can be called from any thread.
BUG=
Review-Url: https://codereview.webrtc.org/1988043002
Cr-Commit-Position: refs/heads/master@{#12941}
Due to the experiment in chromium relying on KT_DEFAULT = KT_RSA (bug:
crbug.com/611698) a conditional was introduced. Now that the experiment is
ending and the experiment flag has been removed we can make KT_DEFAULT=KT_ECDSA
unconditionally.
BUG=chromium:611698
Review-Url: https://codereview.webrtc.org/2009533003
Cr-Commit-Position: refs/heads/master@{#12935}
This CL adds these classes but does not change any functonality or interface
yet. This is in preparation for future CLs. To be used for this:
https://codereview.webrtc.org/2000163002/
RTCCertificateGenerator is meant to replace DtlsIdentityStoreInterface and
implementations. In order to continue to support mocking and to help with the
transition, RTCCertificateGenerator gets an interface that it implements (just
like the store has both interface and impl).
PeerConnectionFactoryInterface::CreatePeerConnection will take an
RTCCertificateGeneratorInterface instead of DtlsIdentityStoreInterface. As to
not break Chromium, both versions of CreatePeerConnection need to exist for a
transition period. This will be done by wrapping a store into a generator
wrapper - RTCCertificateGeneratorStoreWrapper.
BUG=webrtc:5707, webrtc:5708
R=hta@webrtc.org, tommi@chromium.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2001103002 .
Cr-Commit-Position: refs/heads/master@{#12879}
This is needed as there are targets such as newlib_pnacl/remoting_client_plugin_newlib.pexe that depend on rtc_base_approved but don't need TaskQueue. We could implement support for TaskQueue in nacl using ppapi types, but it looks like there isn't a need for it. Libevent isn't supported for nacl either, so I'm introducing a layer on top of rtc_base_approved for TaskQueue. It's conceivable that this target will morph into a target that holds other threading primitives such as platform_thread and possibly socket related operations, which is also an area that we currently #ifdef out for nacl in a few places.
Functional change: Removes the "is_nacl" check.
R=phoglund@webrtc.org
Review-Url: https://codereview.webrtc.org/2001913002
Cr-Commit-Position: refs/heads/master@{#12878}
Reason for revert:
Seems like this CL cause
DtlsTransportChannelTest.TestReceiveClientHelloBeforeRemoteFingerprint
DtlsTransportChannelTest.TestReceiveClientHelloBeforeWritable
to consistently fail on Win DrMemory Full and for
DtlsTransportChannelTest.TestReceiveClientHelloBeforeRemoteFingerprint
DtlsTransportChannelTest.TestReceiveClientHelloBeforeWritable
to consistently fail on Linux Memcheck
Original issue's description:
> Change initial DTLS retransmission timer from 1 second to 50ms.
>
> This will help ensure a timely DTLS handshake when there's packet
> loss. It will likely result in spurious retransmissions (since the
> RTT is usually > 50ms), but since exponential backoff is still used,
> there will at most be ~4 extra retransmissions. For a time-sensitive
> application like WebRTC this seems like a reasonable tradeoff.
>
> R=juberti@chromium.org, juberti@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/1e435628366fb9fed71632369f05928ed857d8ef
> Cr-Commit-Position: refs/heads/master@{#12853}
TBR=pthatcher@webrtc.org,juberti@webrtc.org,juberti@chromium.org,deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.webrtc.org/2002403002
Cr-Commit-Position: refs/heads/master@{#12864}
This will help ensure a timely DTLS handshake when there's packet
loss. It will likely result in spurious retransmissions (since the
RTT is usually > 50ms), but since exponential backoff is still used,
there will at most be ~4 extra retransmissions. For a time-sensitive
application like WebRTC this seems like a reasonable tradeoff.
R=juberti@chromium.org, juberti@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1981463002 .
Cr-Commit-Position: refs/heads/master@{#12853}
This helps a lot on Android devices where the user threads can be scheduled with low priority when the app is in the background, causing spurious significantly delayed before a packet can be read from the socket. With this patch the timestamp is taken by the kernel when the packet actually arrives.
R=juberti@chromium.orgTBR=juberti@webrtc.org
BUG=webrtc:5773
Review URL: https://codereview.webrtc.org/1944683002 .
Cr-Commit-Position: refs/heads/master@{#12850}
if the network monitor detects it after the native code does.
Also set the network cost for ethernet, wifi, unknown, cellular network type to be 0, 10, 50, 900,
so that unknown networks will have lower precedence than known networks with low cost (like Wifi) but higher precedence than known networks with high cost.
And third, infer network type based on limited name matching in Android if there is no network monitor or network monitor did not find the type.
BUG=webrtc:5890
R=pthatcher@chromium.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1976683003 .
Cr-Commit-Position: refs/heads/master@{#12833}
ACCESS_ON is an alias of GUARDED_BY but should take thread-like object instead of mutex,
RUN_ON is an alias of EXCLUSIVE_LOCKS_REQUIRED to annotate function always run on same
thread/task_queue
RTC_DCHECK_RUN_ON - creates an object that allows use of annotated variables and functions, and adds a run-time DCHECK given thread/queue is current.
R=tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/1981893002
Cr-Commit-Position: refs/heads/master@{#12812}
We're now ready https://codereview.webrtc.org/1984503002/ downstream,
so make sure we can enable libevent but still choose which libevent
implementation to use. This follows the common pattern where an enable_
flag controls whether we should use the feature at all, whereas build_
controls if we should use the dependency from our DEPS file or
something else.
NOTRY=True
Review-Url: https://codereview.webrtc.org/1980003002
Cr-Commit-Position: refs/heads/master@{#12772}
New task queueing primitive for async tasks: TaskQueue.
TaskQueue is a new way to asynchronously execute tasks sequentially
in a thread safe manner with minimal locking. The implementation
uses OS supported APIs to do this that are compatible with async IO
notifications from things like sockets and files.
This class is a part of rtc_base_approved, so can be used by both
the webrtc and libjingle parts of the WebRTC library. Moving forward,
we can replace rtc::Thread and webrtc::ProcessThread with this implementation.
NOTE: It should not be assumed that all tasks that execute on a TaskQueue,
run on the same thread. E.g. on Mac and iOS, we use GCD dispatch queues
which means that tasks might execute on different threads depending on
what's the most efficient thing to do.
TBR=perkj@webrtc.org,phoglund@webrtc.org
Review-Url: https://codereview.webrtc.org/1984503002
Cr-Commit-Position: refs/heads/master@{#12749}
Reason for revert:
sigh. Have to revert again as there seems to have have been some change made for pnacl and CrOS.
Original issue's description:
> Reland of New task queueing primitive for async tasks: TaskQueue. (patchset #1 id:1 of https://codereview.webrtc.org/1935483002/ )
>
> New task queueing primitive for async tasks: TaskQueue.
> TaskQueue is a new way to asynchronously execute tasks sequentially
> in a thread safe manner with minimal locking. The implementation
> uses OS supported APIs to do this that are compatible with async IO
> notifications from things like sockets and files.
>
> This class is a part of rtc_base_approved, so can be used by both
> the webrtc and libjingle parts of the WebRTC library. Moving forward,
> we can replace rtc::Thread and webrtc::ProcessThread with this implementation.
>
> NOTE: It should not be assumed that all tasks that execute on a TaskQueue,
> run on the same thread. E.g. on Mac and iOS, we use GCD dispatch queues
> which means that tasks might execute on different threads depending on
> what's the most efficient thing to do.
>
> TBR=perkj@webrtc.org
>
> Committed: https://crrev.com/65d1f2aba216d077c6d22488f03e56984aef1c68
> Cr-Commit-Position: refs/heads/master@{#12737}
TBR=perkj@webrtc.org,phoglund@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.webrtc.org/1981573002
Cr-Commit-Position: refs/heads/master@{#12738}
New task queueing primitive for async tasks: TaskQueue.
TaskQueue is a new way to asynchronously execute tasks sequentially
in a thread safe manner with minimal locking. The implementation
uses OS supported APIs to do this that are compatible with async IO
notifications from things like sockets and files.
This class is a part of rtc_base_approved, so can be used by both
the webrtc and libjingle parts of the WebRTC library. Moving forward,
we can replace rtc::Thread and webrtc::ProcessThread with this implementation.
NOTE: It should not be assumed that all tasks that execute on a TaskQueue,
run on the same thread. E.g. on Mac and iOS, we use GCD dispatch queues
which means that tasks might execute on different threads depending on
what's the most efficient thing to do.
TBR=perkj@webrtc.org
Review-Url: https://codereview.webrtc.org/1927133004
Cr-Commit-Position: refs/heads/master@{#12737}
Without this, some toolchains may fail to build base/checks.cc
because errno is undefined.
NOTRY=true
Review-Url: https://codereview.webrtc.org/1971513002
Cr-Commit-Position: refs/heads/master@{#12696}
Reason for revert:
Breaks user code. Said code needs to stop using scoped_ptr!
Original issue's description:
> Remove webrtc/base/scoped_ptr.h
>
> BUG=webrtc:5520
>
> NOTRY=True
>
> Committed: https://crrev.com/65fc62e9dd8a8716db625aaef76ab92f542ecc5a
> Cr-Commit-Position: refs/heads/master@{#12684}
TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1965063003
Cr-Commit-Position: refs/heads/master@{#12686}
Instead, use a neat trick with union to ensure that we have a T only
when we're supposed to (and just a bunch of unused memory otherwise).
This is how std::optional behaves, so it makes sense for us to do the
same (and it's convenient, too, since we don't have to pay for the
default-constructed T, and we support types that don't have default
constructors).
Doing this became possible recently when we dropped support for MSVC
2013, which didn't support unions containing non-trivial types.
Review-Url: https://codereview.webrtc.org/1896833004
Cr-Commit-Position: refs/heads/master@{#12664}
Reason for revert:
Breaks downstream gtest usage.
Original issue's description:
> Remove the rtc_relative_path GYP variable and similar defines
>
> This is a reland of https://codereview.webrtc.org/1903553003/ but with
> the SRTP changes removed, since they're needed downstream.
>
> The defines that can be used to alter the include paths for Expat and gtest
> are no longer needed in WebRTC or Chromium. Remove them to simplify GYP.
>
> Removed defines:
> EXPAT_RELATIVE_PATH
> GTEST_RELATIVE_PATH
>
> They're all set in the Chromium build so this shouldn't affect Chromium:
> https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/libjingle.gyp
>
> BUG=webrtc:4256
> NOTRY=True
> NOPRESUBMIT=True
> TBR=perkj@webrtc.org
>
> Committed: https://crrev.com/081254f2c62037d016f9fc961764c6f01cb095da
> Cr-Commit-Position: refs/heads/master@{#12536}
TBR=perkj@webrtc.org,kjellander@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:4256
Review-Url: https://codereview.webrtc.org/1945803003
Cr-Commit-Position: refs/heads/master@{#12622}
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}