OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 virtual void run(double deadlineSeconds) = 0; | 50 virtual void run(double deadlineSeconds) = 0; |
51 }; | 51 }; |
52 | 52 |
53 class BLINK_PLATFORM_EXPORT TaskObserver { | 53 class BLINK_PLATFORM_EXPORT TaskObserver { |
54 public: | 54 public: |
55 virtual ~TaskObserver() { } | 55 virtual ~TaskObserver() { } |
56 virtual void willProcessTask() = 0; | 56 virtual void willProcessTask() = 0; |
57 virtual void didProcessTask() = 0; | 57 virtual void didProcessTask() = 0; |
58 }; | 58 }; |
59 | 59 |
| 60 // Headless Chrome virtualises time for determinism and performance (fast fo
rwarding |
| 61 // of timers). To make this work some parts of blink (e.g. Timers) need to u
se virtual |
| 62 // time, however by default new code should use the normal non-virtual time
APIs. |
| 63 virtual double virtualTimeSeconds() = 0; |
| 64 virtual double monotonicallyIncreasingVirtualTimeSeconds() = 0; |
60 | 65 |
61 // Returns a WebTaskRunner bound to the underlying scheduler's default task
queue. | 66 // Returns a WebTaskRunner bound to the underlying scheduler's default task
queue. |
62 virtual WebTaskRunner* taskRunner() { return nullptr; } | 67 virtual WebTaskRunner* taskRunner() { return nullptr; } |
63 | 68 |
64 virtual bool isCurrentThread() const = 0; | 69 virtual bool isCurrentThread() const = 0; |
65 virtual PlatformThreadId threadId() const { return 0; } | 70 virtual PlatformThreadId threadId() const { return 0; } |
66 | 71 |
67 virtual void addTaskObserver(TaskObserver*) { } | 72 virtual void addTaskObserver(TaskObserver*) { } |
68 virtual void removeTaskObserver(TaskObserver*) { } | 73 virtual void removeTaskObserver(TaskObserver*) { } |
69 | 74 |
70 // Returns the scheduler associated with the thread. | 75 // Returns the scheduler associated with the thread. |
71 virtual WebScheduler* scheduler() const = 0; | 76 virtual WebScheduler* scheduler() const = 0; |
72 | 77 |
73 virtual ~WebThread() { } | 78 virtual ~WebThread() { } |
74 }; | 79 }; |
75 | 80 |
76 } // namespace blink | 81 } // namespace blink |
77 | 82 |
78 #endif | 83 #endif |
OLD | NEW |