Commit graph

10 commits

Author SHA1 Message Date
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
Danil Chapovalov
2c6ea52369 In TaskQueueTest::PostDelayedAfterDesctruct increase timeout
from 2x expected time to 10x.
To decrease flakiness for task queue implemntations that destroy tasks
after destruction of the task queue.

Bug: chromium:1000531
Change-Id: Ieb37ff782ead585e0aa2c84472e3993107c5c072
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152830
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29204}
2019-09-17 09:36:47 +00:00
Danil Chapovalov
95e0a607f6 Increase TaskQueueTest.PostALot timeouts
recent changed decreased timeout from forever to 1s which is not enough on some platforms
Increase timeout to forever for posting 65k tasks.
Also increase timeout for eventual destruction of the tasks to reduce change it would flake.

Bug: chromium:972917
Change-Id: I4948d49c1514833ab190856fdd25a47a5bad91eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141410
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28235}
2019-06-11 14:42:18 +00:00
Danil Chapovalov
f504dd305d Rewrite TaskQueueTest.PostALot
avoid waiting while executing a Task to discourage blocking.

fix accessing tasks_clean_up counter since after TaskQueue is destroyed,
it doesn't guarantee sequential execution of the destructors, nor
that all pending tasks are destroyed at that moment.
Instead verify that all posted tasks will be destroyed eventually.

Bug: None
Change-Id: I4cfc97ac0787fe2d0b9d2f0d712a37ae0ca9e1aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140288
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28208}
2019-06-10 11:00:44 +00:00
François Doray
8ea977d2fd Add ScopedAllowBaseSyncPrimitivesForTesting to Webrtc.
Chromium requires that all code that waits on a sync primitive be
annotated with ScopedAllowBaseSyncPrimitives(ForTesting). Webrtc
already imports ScopedAllowBaseSyncPrimitives.
ScopedAllowBaseSyncPrimitivesForTesting is equivalent but can only
be used in tests and doesn't required adding a friend declaration to
thread_restrictions.h.

Previously, the code that is annotated with
ScopedAllowBaseSyncPrimitivesForTesting in this CL didn't fail because
it ran on a TaskRunner annotated with the deprecated
WithBaseSyncPrimitives() trait (cf.
https://cs.chromium.org/chromium/src/content/renderer/media/webrtc/task_queue_factory_unittest.cc?l=23&rcl=362f3723ac358d932ea2e3af65512a1243697a31).

Change-Id: Id7cfa2ea108870de86dc887458ae783c807791cc
Bug: chromium:889029
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128823
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27339}
2019-03-28 13:07:33 +00:00
Danil Chapovalov
3b548ddb1c Move rtc::NewClosure into own build target as ToQueuedTask
to make it usable without need to depend on rtc_task_queue

Bug: webrtc:10191
Change-Id: I2ae1445cf5d498aa6928d66b6823f2f940987767
Reviewed-on: https://webrtc-review.googlesource.com/c/125084
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26942}
2019-03-04 09:00:38 +00:00
Danil Chapovalov
710f3d3e44 Use task queue factory factory as parameter for TaskQueueTest
The new parameter simplify TaskQueueFactory lifetime and
allows insertion of per TestCase state

Bug: webrtc:10191
Change-Id: If4948df2756580957052b2b333b5c12cf4914d55
Reviewed-on: https://webrtc-review.googlesource.com/c/121648
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26583}
2019-02-07 11:00:17 +00:00
Artem Titov
01f64e0eb2 Add test to verify TaskQueue memory access order.
Bug: webrtc:10138
Change-Id: I53e8a3a612ad44feced8d63a4035d79b7e0f22a9
Reviewed-on: https://webrtc-review.googlesource.com/c/120601
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26497}
2019-01-31 14:45:45 +00:00
Steve Anton
f380284035 (7) Rename files to snake_case: remove forwarding headers
Bug: webrtc:10159
Change-Id: I2ba899e0283b953538c7941c8790213e36d7c70e
Reviewed-on: https://webrtc-review.googlesource.com/c/118561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26417}
2019-01-26 00:33:46 +00:00
Danil Chapovalov
33b716f7dd Publish task queue test suite.
The set of tests is a copy of rtc_base/task_queue_unittests excluding tests
that verify rtc::NewClosure rather than task queue implementation itself.

Bug: webrtc:10191
Change-Id: I94e962ad63ff6510c43a97ef0cd4da7d08f25538
Reviewed-on: https://webrtc-review.googlesource.com/c/118445
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26369}
2019-01-23 11:55:12 +00:00