v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1// Copyright 2020 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 INCLUDE_CPPGC_PLATFORM_H_
6#define INCLUDE_CPPGC_PLATFORM_H_
7
8#include <memory>
9
11#include "v8-platform.h" // NOLINT(build/include_directory)
12#include "v8config.h" // NOLINT(build/include_directory)
13
14namespace cppgc {
15
16// TODO(v8:10346): Create separate includes for concepts that are not
17// V8-specific.
23using Task = v8::Task;
27
32 public:
33 virtual ~Platform() = default;
34
41
49 virtual double MonotonicallyIncreasingTime() = 0;
50
54 virtual std::shared_ptr<TaskRunner> GetForegroundTaskRunner() {
55 return nullptr;
56 }
57
117 virtual std::unique_ptr<JobHandle> PostJob(
118 TaskPriority priority, std::unique_ptr<JobTask> job_task) {
119 return nullptr;
120 }
121
128};
129
144V8_EXPORT void InitializeProcess(PageAllocator* page_allocator = nullptr,
145 size_t desired_heap_size = 0);
146
153
154namespace internal {
155
156V8_EXPORT void Fatal(const std::string& reason = std::string(),
158
159} // namespace internal
160
161} // namespace cppgc
162
163#endif // INCLUDE_CPPGC_PLATFORM_H_
virtual ~Platform()=default
virtual std::unique_ptr< JobHandle > PostJob(TaskPriority priority, std::unique_ptr< JobTask > job_task)
Definition platform.h:117
virtual PageAllocator * GetPageAllocator()=0
virtual TracingController * GetTracingController()
virtual std::shared_ptr< TaskRunner > GetForegroundTaskRunner()
Definition platform.h:54
virtual double MonotonicallyIncreasingTime()=0
static constexpr SourceLocation Current()
V8_EXPORT void Fatal(const std::string &reason=std::string(), const SourceLocation &=SourceLocation::Current())
V8_EXPORT void InitializeProcess(PageAllocator *page_allocator=nullptr, size_t desired_heap_size=0)
V8_EXPORT void ShutdownProcess()
TaskPriority
Definition v8-platform.h:24
#define V8_EXPORT
Definition v8config.h:753