V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
libplatform.h
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 
8 #include "libplatform/libplatform-export.h"
9 #include "libplatform/v8-tracing.h"
10 #include "v8-platform.h" // NOLINT(build/include)
11 #include "v8config.h" // NOLINT(build/include)
12 
13 namespace v8 {
14 namespace platform {
15 
16 enum class IdleTaskSupport { kDisabled, kEnabled };
17 enum class InProcessStackDumping { kDisabled, kEnabled };
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 =
41  InProcessStackDumping::kDisabled,
42  std::unique_ptr<v8::TracingController> tracing_controller = {});
43 
44 V8_PLATFORM_EXPORT V8_DEPRECATE_SOON(
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 =
50  InProcessStackDumping::kDisabled,
51  v8::TracingController* tracing_controller = nullptr));
52 
61 V8_PLATFORM_EXPORT bool PumpMessageLoop(
62  v8::Platform* platform, v8::Isolate* isolate,
63  MessageLoopBehavior behavior = MessageLoopBehavior::kDoNotWait);
64 
72 V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform,
73  v8::Isolate* isolate,
74  double idle_time_in_seconds);
75 
82 V8_PLATFORM_EXPORT V8_DEPRECATE_SOON(
83  "Access the DefaultPlatform directly",
84  void SetTracingController(
85  v8::Platform* platform,
86  v8::platform::tracing::TracingController* tracing_controller));
87 
88 } // namespace platform
89 } // namespace v8
90 
91 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
Definition: libplatform.h:13