| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #if defined(WEBRTC_WIN) | 11 #if defined(WEBRTC_WIN) |
| 12 // clang-format off | 12 // clang-format off |
| 13 #include <windows.h> // Must come first. | 13 #include <windows.h> // Must come first. |
| 14 #include <mmsystem.h> | 14 #include <mmsystem.h> |
| 15 // clang-format on | 15 // clang-format on |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #include <memory> | 18 #include <memory> |
| 19 #include <vector> | 19 #include <vector> |
| 20 | 20 |
| 21 #include "webrtc/base/bind.h" | 21 #include "webrtc/rtc_base/bind.h" |
| 22 #include "webrtc/base/event.h" | 22 #include "webrtc/rtc_base/event.h" |
| 23 #include "webrtc/base/gunit.h" | 23 #include "webrtc/rtc_base/gunit.h" |
| 24 #include "webrtc/base/task_queue.h" | 24 #include "webrtc/rtc_base/task_queue.h" |
| 25 #include "webrtc/base/timeutils.h" | 25 #include "webrtc/rtc_base/timeutils.h" |
| 26 | 26 |
| 27 namespace rtc { | 27 namespace rtc { |
| 28 namespace { | 28 namespace { |
| 29 // Noop on all platforms except Windows, where it turns on high precision | 29 // Noop on all platforms except Windows, where it turns on high precision |
| 30 // multimedia timers which increases the precision of TimeMillis() while in | 30 // multimedia timers which increases the precision of TimeMillis() while in |
| 31 // scope. | 31 // scope. |
| 32 class EnableHighResTimers { | 32 class EnableHighResTimers { |
| 33 public: | 33 public: |
| 34 #if !defined(WEBRTC_WIN) | 34 #if !defined(WEBRTC_WIN) |
| 35 EnableHighResTimers() {} | 35 EnableHighResTimers() {} |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 queue.PostTask(NewClosure([&tasks_executed]() { ++tasks_executed; }, | 322 queue.PostTask(NewClosure([&tasks_executed]() { ++tasks_executed; }, |
| 323 [&tasks_cleaned_up]() { ++tasks_cleaned_up; })); | 323 [&tasks_cleaned_up]() { ++tasks_cleaned_up; })); |
| 324 event.Set(); // Unblock the first task. | 324 event.Set(); // Unblock the first task. |
| 325 } | 325 } |
| 326 | 326 |
| 327 EXPECT_GE(tasks_cleaned_up, tasks_executed); | 327 EXPECT_GE(tasks_cleaned_up, tasks_executed); |
| 328 EXPECT_EQ(kTaskCount, tasks_cleaned_up); | 328 EXPECT_EQ(kTaskCount, tasks_cleaned_up); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace rtc | 331 } // namespace rtc |
| OLD | NEW |