v8  4.6.85(node5.12.0)
V8 is Google's open source JavaScript engine
v8-platform.h
Go to the documentation of this file.
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
3 // found in the LICENSE file.
4 
5 #ifndef V8_V8_PLATFORM_H_
6 #define V8_V8_PLATFORM_H_
7 
8 namespace v8 {
9 
10 class Isolate;
11 
15 class Task {
16  public:
17  virtual ~Task() {}
18 
19  virtual void Run() = 0;
20 };
21 
22 
29 class IdleTask {
30  public:
31  virtual ~IdleTask() {}
32  virtual void Run(double deadline_in_seconds) = 0;
33 };
34 
35 
42 class Platform {
43  public:
52  };
53 
54  virtual ~Platform() {}
55 
63  virtual void CallOnBackgroundThread(Task* task,
64  ExpectedRuntime expected_runtime) = 0;
65 
71  virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0;
72 
79  virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
80  double delay_in_seconds) = 0;
81 
90  virtual void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) {
91  // TODO(ulan): Make this function abstract after V8 roll in Chromium.
92  }
93 
97  virtual bool IdleTasksEnabled(Isolate* isolate) {
98  // TODO(ulan): Make this function abstract after V8 roll in Chromium.
99  return false;
100  }
101 
109  virtual double MonotonicallyIncreasingTime() = 0;
110 };
111 
112 } // namespace v8
113 
114 #endif // V8_V8_PLATFORM_H_
virtual void Run()=0
virtual ~Task()
Definition: v8-platform.h:17
virtual ~Platform()
Definition: v8-platform.h:54
virtual void CallOnBackgroundThread(Task *task, ExpectedRuntime expected_runtime)=0
Definition: libplatform.h:10
virtual bool IdleTasksEnabled(Isolate *isolate)
Definition: v8-platform.h:97
virtual double MonotonicallyIncreasingTime()=0
virtual void CallIdleOnForegroundThread(Isolate *isolate, IdleTask *task)
Definition: v8-platform.h:90
virtual void Run(double deadline_in_seconds)=0
virtual void CallOnForegroundThread(Isolate *isolate, Task *task)=0
virtual void CallDelayedOnForegroundThread(Isolate *isolate, Task *task, double delay_in_seconds)=0
virtual ~IdleTask()
Definition: v8-platform.h:31