v8 11.3.244 (node 20.3.0)
V8 is Google's open source JavaScript engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
140V8_EXPORT void InitializeProcess(PageAllocator* page_allocator = nullptr);
141
148
149namespace internal {
150
151V8_EXPORT void Fatal(const std::string& reason = std::string(),
153
154} // namespace internal
155
156} // namespace cppgc
157
158#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 ShutdownProcess()
V8_EXPORT void InitializeProcess(PageAllocator *page_allocator=nullptr)
TaskPriority
Definition v8-platform.h:23
#define V8_EXPORT
Definition v8config.h:719