v8  6.8.275(node10.15.3)
V8 is Google's open source JavaScript engine
libplatform.h
Go to the documentation of this file.
1 // Copyright 2014 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_LIBPLATFORM_LIBPLATFORM_H_
6 #define V8_LIBPLATFORM_LIBPLATFORM_H_
7 
10 #include "v8-platform.h" // NOLINT(build/include)
11 #include "v8config.h" // NOLINT(build/include)
12 
13 namespace v8 {
14 namespace platform {
15 
18 
19 enum class MessageLoopBehavior : bool {
20  kDoNotWait = false,
21  kWaitForWork = true
22 };
23 
37 V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
38  int thread_pool_size = 0,
39  IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
40  InProcessStackDumping in_process_stack_dumping =
42  std::unique_ptr<v8::TracingController> tracing_controller = {});
43 
45  "Use NewDefaultPlatform instead",
46  v8::Platform* CreateDefaultPlatform(
47  int thread_pool_size = 0,
48  IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
49  InProcessStackDumping in_process_stack_dumping =
51  v8::TracingController* tracing_controller = nullptr));
52 
62  v8::Platform* platform, v8::Isolate* isolate,
64 
66  "This function has become obsolete and is essentially a nop",
67  void EnsureEventLoopInitialized(v8::Platform* platform,
68  v8::Isolate* isolate));
69 
78  v8::Isolate* isolate,
79  double idle_time_in_seconds);
80 
88  "Access the DefaultPlatform directly",
89  void SetTracingController(
90  v8::Platform* platform,
91  v8::platform::tracing::TracingController* tracing_controller));
92 
93 } // namespace platform
94 } // namespace v8
95 
96 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
V8_PLATFORM_EXPORT V8_DEPRECATE_SOON("Use NewDefaultPlatform instead", v8::Platform *CreateDefaultPlatform(int thread_pool_size=0, IdleTaskSupport idle_task_support=IdleTaskSupport::kDisabled, InProcessStackDumping in_process_stack_dumping=InProcessStackDumping::kDisabled, v8::TracingController *tracing_controller=nullptr))
#define V8_PLATFORM_EXPORT
Definition: libplatform.h:13
V8_PLATFORM_EXPORT std::unique_ptr< v8::Platform > NewDefaultPlatform(int thread_pool_size=0, IdleTaskSupport idle_task_support=IdleTaskSupport::kDisabled, InProcessStackDumping in_process_stack_dumping=InProcessStackDumping::kDisabled, std::unique_ptr< v8::TracingController > tracing_controller={})
V8_PLATFORM_EXPORT bool PumpMessageLoop(v8::Platform *platform, v8::Isolate *isolate, MessageLoopBehavior behavior=MessageLoopBehavior::kDoNotWait)
V8_PLATFORM_EXPORT V8_DEPRECATED("This function has become obsolete and is essentially a nop", void EnsureEventLoopInitialized(v8::Platform *platform, v8::Isolate *isolate))
V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform *platform, v8::Isolate *isolate, double idle_time_in_seconds)