OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 |
(...skipping 15 matching lines...) Loading... |
26 #include "webrtc/base/gunit.h" | 26 #include "webrtc/base/gunit.h" |
27 #include "webrtc/base/logging.h" | 27 #include "webrtc/base/logging.h" |
28 #include "webrtc/base/task.h" | 28 #include "webrtc/base/task.h" |
29 #include "webrtc/base/taskrunner.h" | 29 #include "webrtc/base/taskrunner.h" |
30 #include "webrtc/base/thread.h" | 30 #include "webrtc/base/thread.h" |
31 #include "webrtc/base/timeutils.h" | 31 #include "webrtc/base/timeutils.h" |
32 | 32 |
33 namespace rtc { | 33 namespace rtc { |
34 | 34 |
35 static int64_t GetCurrentTime() { | 35 static int64_t GetCurrentTime() { |
36 return static_cast<int64_t>(Time()) * 10000; | 36 return TimeMillis() * 10000; |
37 } | 37 } |
38 | 38 |
39 // feel free to change these numbers. Note that '0' won't work, though | 39 // feel free to change these numbers. Note that '0' won't work, though |
40 #define STUCK_TASK_COUNT 5 | 40 #define STUCK_TASK_COUNT 5 |
41 #define HAPPY_TASK_COUNT 20 | 41 #define HAPPY_TASK_COUNT 20 |
42 | 42 |
43 // this is a generic timeout task which, when it signals timeout, will | 43 // this is a generic timeout task which, when it signals timeout, will |
44 // include the unique ID of the task in the signal (we don't use this | 44 // include the unique ID of the task in the signal (we don't use this |
45 // in production code because we haven't yet had occasion to generate | 45 // in production code because we haven't yet had occasion to generate |
46 // an array of the same types of task) | 46 // an array of the same types of task) |
(...skipping 487 matching lines...) Loading... |
534 // Do not start the task. | 534 // Do not start the task. |
535 // Note: this leaks memory, so don't do this. | 535 // Note: this leaks memory, so don't do this. |
536 // Instead, always run your tasks or delete them. | 536 // Instead, always run your tasks or delete them. |
537 new HappyTask(happy_task); | 537 new HappyTask(happy_task); |
538 | 538 |
539 // run the unblocked tasks | 539 // run the unblocked tasks |
540 task_runner.RunTasks(); | 540 task_runner.RunTasks(); |
541 } | 541 } |
542 | 542 |
543 } // namespace rtc | 543 } // namespace rtc |
OLD | NEW |