11cb0ef41Sopenharmony_ci// Copyright 2021 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#ifndef INCLUDE_V8_MICROTASK_H_ 61cb0ef41Sopenharmony_ci#define INCLUDE_V8_MICROTASK_H_ 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cinamespace v8 { 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciclass Isolate; 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci// --- Microtasks Callbacks --- 131cb0ef41Sopenharmony_ciusing MicrotasksCompletedCallbackWithData = void (*)(Isolate*, void*); 141cb0ef41Sopenharmony_ciusing MicrotaskCallback = void (*)(void* data); 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci/** 171cb0ef41Sopenharmony_ci * Policy for running microtasks: 181cb0ef41Sopenharmony_ci * - explicit: microtasks are invoked with the 191cb0ef41Sopenharmony_ci * Isolate::PerformMicrotaskCheckpoint() method; 201cb0ef41Sopenharmony_ci * - scoped: microtasks invocation is controlled by MicrotasksScope objects; 211cb0ef41Sopenharmony_ci * - auto: microtasks are invoked when the script call depth decrements 221cb0ef41Sopenharmony_ci * to zero. 231cb0ef41Sopenharmony_ci */ 241cb0ef41Sopenharmony_cienum class MicrotasksPolicy { kExplicit, kScoped, kAuto }; 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci} // namespace v8 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci#endif // INCLUDE_V8_MICROTASK_H_ 29