Commit graph

6 commits

Author SHA1 Message Date
Tomas Gunnarsson
abdb470d00 Make MessageHandler cleanup optional.
As documented in webrtc:11908 this cleanup is fairly invasive and
when a part of a frequently executed code path, can be quite costly
in terms of performance overhead. This is currently the case with
synchronous calls between threads (Thread) as well with our proxy
api classes.

With this CL, all code in WebRTC should now either be using MessageHandlerAutoCleanup
or calling MessageHandler(false) explicitly.

Next steps will be to update external code to either depend on the
AutoCleanup variant, or call MessageHandler(false).

Changing the proxy classes to use TaskQueue set of concepts instead of
MessageHandler. This avoids the perf overhead related to the cleanup
above as well as incompatibility with the thread policy checks in
Thread that some current external users of the proxies would otherwise
run into (if we were to use Thread::Send() for synchronous call).

Following this we'll move the cleanup step into the AutoCleanup class
and an RTC_DCHECK that all calls to the MessageHandler are setting
the flag to false, before eventually removing the flag and make
MessageHandler pure virtual.

Bug: webrtc:11908
Change-Id: Idf4ff9bcc8438cb8c583777e282005e0bc511c8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183442
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32049}
2020-09-07 12:57:15 +00:00
Guido Urdaneta
ccab06fb72 Revert "Replaces SynchronousMethodCall with rtc::Thread::Invoke."
This reverts commit b0e0728159.

Reason for revert:

Causes Chromium tests to timeout, preventing rolls into Chromium.

Original change's description:
> Replaces SynchronousMethodCall with rtc::Thread::Invoke.
> 
> Given that we already have Thread:.Invoke that can be used with lambda,
> SynchronousMethodCall doesn't add any value.
> 
> This simplification prepares for simulated time peer connection tests.
> 
> Bug: webrtc:11255
> Change-Id: I478a11f15e30e009dae4a3fee2120f6d7a03355f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165683
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30217}

TBR=steveanton@webrtc.org,srte@webrtc.org

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

Bug: webrtc:11255
Change-Id: I9d3aa218013129db7a09a77500a0547ce9ae341a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166047
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30265}
2020-01-15 12:34:35 +00:00
Sebastian Jansson
b0e0728159 Replaces SynchronousMethodCall with rtc::Thread::Invoke.
Given that we already have Thread:.Invoke that can be used with lambda,
SynchronousMethodCall doesn't add any value.

This simplification prepares for simulated time peer connection tests.

Bug: webrtc:11255
Change-Id: I478a11f15e30e009dae4a3fee2120f6d7a03355f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165683
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30217}
2020-01-10 19:29:34 +00:00
Niels Möller
58376f376a Make member internal::SynchronousMethodCall::e_ a non-pointer.
Bug: None
Change-Id: Id634f1c1ccab8de7862160f30f64b5a5e7a19ae9
Reviewed-on: https://webrtc-review.googlesource.com/c/111080
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25650}
2018-11-15 10:42:36 +00:00
Niels Möller
c572ff3c71 Add default constructor for rtc::Event
Bug: webrtc:9962
Change-Id: Icaa91e657e6881fcb1553f354c07866109a0ea68
Reviewed-on: https://webrtc-review.googlesource.com/c/109500
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25535}
2018-11-07 08:57:50 +00:00
Steve Anton
f2737d23d1 Enable the clang style plugin in primary p2p/ target
Bug: webrtc:163
Change-Id: I318982ee549fe71cd48f74cdfad4173506742411
Reviewed-on: https://webrtc-review.googlesource.com/17040
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20509}
2017-11-01 00:19:05 +00:00