OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_V8_PLATFORM_H_ | 5 #ifndef V8_V8_PLATFORM_H_ |
6 #define V8_V8_PLATFORM_H_ | 6 #define V8_V8_PLATFORM_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 | 9 |
10 class Isolate; | 10 class Isolate; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 ExpectedRuntime expected_runtime) = 0; | 50 ExpectedRuntime expected_runtime) = 0; |
51 | 51 |
52 /** | 52 /** |
53 * Schedules a task to be invoked on a foreground thread wrt a specific | 53 * Schedules a task to be invoked on a foreground thread wrt a specific |
54 * |isolate|. Tasks posted for the same isolate should be execute in order of | 54 * |isolate|. Tasks posted for the same isolate should be execute in order of |
55 * scheduling. The definition of "foreground" is opaque to V8. | 55 * scheduling. The definition of "foreground" is opaque to V8. |
56 */ | 56 */ |
57 virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; | 57 virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; |
58 | 58 |
59 /** | 59 /** |
| 60 * Schedules a task to be invoked on a foreground thread wrt a specific |
| 61 * |isolate| after the given number of seconds |delay_in_seconds|. |
| 62 * Tasks posted for the same isolate should be execute in order of |
| 63 * scheduling. The definition of "foreground" is opaque to V8. |
| 64 */ |
| 65 virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, |
| 66 double delay_in_seconds) { |
| 67 // TODO(ulan): Make this function abstract after V8 roll in Chromium. |
| 68 } |
| 69 |
| 70 /** |
60 * Monotonically increasing time in seconds from an arbitrary fixed point in | 71 * Monotonically increasing time in seconds from an arbitrary fixed point in |
61 * the past. This function is expected to return at least | 72 * the past. This function is expected to return at least |
62 * millisecond-precision values. For this reason, | 73 * millisecond-precision values. For this reason, |
63 * it is recommended that the fixed point be no further in the past than | 74 * it is recommended that the fixed point be no further in the past than |
64 * the epoch. | 75 * the epoch. |
65 **/ | 76 **/ |
66 virtual double MonotonicallyIncreasingTime() = 0; | 77 virtual double MonotonicallyIncreasingTime() = 0; |
67 }; | 78 }; |
68 | 79 |
69 } // namespace v8 | 80 } // namespace v8 |
70 | 81 |
71 #endif // V8_V8_PLATFORM_H_ | 82 #endif // V8_V8_PLATFORM_H_ |
OLD | NEW |