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}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -68,9 +68,8 @@ TEST(SingleThreadedTaskQueueForTestingTest,
// queue at any given time, post one waiting task that would block the
// task-queue, and unblock only after all tasks have been posted.
rtc::Event rendezvous(true, false);
task_queue.PostTask([&rendezvous]() {
ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs));
});
task_queue.PostTask(
[&rendezvous]() { ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs)); });
// Post the tasks which comprise the test.
for (size_t i = 0; i < kCount; i++) {
@ -126,9 +125,8 @@ TEST(SingleThreadedTaskQueueForTestingTest, TasksExecutedInSequence) {
// Prevent the chain from being set in motion before we've had time to
// schedule it all, lest the queue only contain one task at a time.
rtc::Event rendezvous(true, false);
task_queue.PostTask([&rendezvous]() {
ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs));
});
task_queue.PostTask(
[&rendezvous]() { ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs)); });
for (size_t i = 0; i < 3; i++) {
task_queue.PostTask([&accumulator, i]() { // |i| passed by value.
@ -139,9 +137,7 @@ TEST(SingleThreadedTaskQueueForTestingTest, TasksExecutedInSequence) {
// The test will wait for the task-queue to finish.
rtc::Event done(true, false);
task_queue.PostTask([&done]() {
done.Set();
});
task_queue.PostTask([&done]() { done.Set(); });
rendezvous.Set(); // Set the chain in motion.
@ -159,10 +155,12 @@ TEST(SingleThreadedTaskQueueForTestingTest, ExecutesPostedDelayedTask) {
constexpr int64_t delay_ms = 20;
static_assert(delay_ms < kMaxWaitTimeMs / 2, "Delay too long for tests.");
task_queue.PostDelayedTask([&executed, &done]() {
executed.store(true);
done.Set();
}, delay_ms);
task_queue.PostDelayedTask(
[&executed, &done]() {
executed.store(true);
done.Set();
},
delay_ms);
ASSERT_TRUE(done.Wait(kMaxWaitTimeMs));
EXPECT_TRUE(executed.load());
@ -176,9 +174,7 @@ TEST(SingleThreadedTaskQueueForTestingTest, DoesNotExecuteDelayedTaskTooSoon) {
constexpr int64_t delay_ms = 2000;
static_assert(delay_ms < kMaxWaitTimeMs / 2, "Delay too long for tests.");
task_queue.PostDelayedTask([&executed]() {
executed.store(true);
}, delay_ms);
task_queue.PostDelayedTask([&executed]() { executed.store(true); }, delay_ms);
// Wait less than is enough, make sure the task was not yet executed.
rtc::Event not_done(true, false);
@ -262,16 +258,11 @@ TEST(SingleThreadedTaskQueueForTestingTest, ExternalThreadCancelsTask) {
// Prevent the to-be-cancelled task from being executed before we've had
// time to cancel it.
rtc::Event rendezvous(true, false);
task_queue.PostTask([&rendezvous]() {
ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs));
});
task_queue.PostTask(
[&rendezvous]() { ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs)); });
TaskId cancelled_task_id = task_queue.PostTask([]() {
EXPECT_TRUE(false);
});
task_queue.PostTask([&done]() {
done.Set();
});
TaskId cancelled_task_id = task_queue.PostTask([]() { EXPECT_TRUE(false); });
task_queue.PostTask([&done]() { done.Set(); });
task_queue.CancelTask(cancelled_task_id);
@ -292,9 +283,8 @@ TEST(SingleThreadedTaskQueueForTestingTest, InternalThreadCancelsTask) {
// Prevent the chain from being set-off before we've set everything up.
rtc::Event rendezvous(true, false);
task_queue.PostTask([&rendezvous]() {
ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs));
});
task_queue.PostTask(
[&rendezvous]() { ASSERT_TRUE(rendezvous.Wait(kMaxWaitTimeMs)); });
// This is the canceller-task. It takes cancelled_task_id by reference,
// because the ID will only become known after the cancelled task is
@ -306,15 +296,11 @@ TEST(SingleThreadedTaskQueueForTestingTest, InternalThreadCancelsTask) {
task_queue.PostTask(canceller_task);
// This task will be cancelled by the task before it.
auto cancelled_task = []() {
EXPECT_TRUE(false);
};
auto cancelled_task = []() { EXPECT_TRUE(false); };
cancelled_task_id = task_queue.PostTask(cancelled_task);
// When this task runs, it will allow the test to be finished.
auto completion_marker_task = [&done]() {
done.Set();
};
auto completion_marker_task = [&done]() { done.Set(); };
task_queue.PostTask(completion_marker_task);
rendezvous.Set(); // Set the chain in motion.