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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual void CallOnBackgroundThread(Task* task, | 49 virtual void CallOnBackgroundThread(Task* task, |
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 | |
60 /** | 59 /** |
61 * Monotonically increasing time in seconds from an arbitrary fixed point in | 60 * Monotonically increasing time in seconds from an arbitrary fixed point in |
62 * the past. This function is expected to return at least | 61 * the past. This function is expected to return at least |
63 * millisecond-precision values. For this reason, | 62 * millisecond-precision values. For this reason, |
64 * it is recommended that the fixed point be no further in the past than | 63 * it is recommended that the fixed point be no further in the past than |
65 * the epoch. | 64 * the epoch. |
66 **/ | 65 **/ |
67 virtual double MonotonicallyIncreasingTime() { | 66 virtual double MonotonicallyIncreasingTime() = 0; |
68 // TODO(rmcilroy): Remove this default implementation when Chromium | |
69 // change has landed. | |
70 return 0; | |
71 } | |
72 }; | 67 }; |
73 | 68 |
74 } // namespace v8 | 69 } // namespace v8 |
75 | 70 |
76 #endif // V8_V8_PLATFORM_H_ | 71 #endif // V8_V8_PLATFORM_H_ |
OLD | NEW |