v8 10.2.154 (node 18.16.0)
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
40
48 virtual double MonotonicallyIncreasingTime() = 0;
49
53 virtual std::shared_ptr<TaskRunner> GetForegroundTaskRunner() {
54 return nullptr;
55 }
56
116 virtual std::unique_ptr<JobHandle> PostJob(
117 TaskPriority priority, std::unique_ptr<JobTask> job_task) {
118 return nullptr;
119 }
120
127};
128
139
146
147namespace internal {
148
149V8_EXPORT void Fatal(const std::string& reason = std::string(),
151
152} // namespace internal
153
154} // namespace cppgc
155
156#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:116
virtual PageAllocator * GetPageAllocator()=0
virtual TracingController * GetTracingController()
virtual std::shared_ptr< TaskRunner > GetForegroundTaskRunner()
Definition platform.h:53
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 ShutdownProcess()
V8_EXPORT void InitializeProcess(PageAllocator *page_allocator)
TaskPriority
Definition v8-platform.h:21
#define V8_EXPORT
Definition v8config.h:578