#include "gin/v8_foreground_task_runner_with_locker.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "gin/converter.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-locker.h"
namespace gin {
V8ForegroundTaskRunnerWithLocker::V8ForegroundTaskRunnerWithLocker(
v8::Isolate* isolate,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: … { … }
V8ForegroundTaskRunnerWithLocker::~V8ForegroundTaskRunnerWithLocker() = default;
namespace {
void RunWithLocker(v8::Isolate* isolate, std::unique_ptr<v8::Task> task) { … }
class IdleTaskWithLocker : public v8::IdleTask { … };
}
void V8ForegroundTaskRunnerWithLocker::PostTaskImpl(
std::unique_ptr<v8::Task> task,
const v8::SourceLocation& location) { … }
void V8ForegroundTaskRunnerWithLocker::PostNonNestableTaskImpl(
std::unique_ptr<v8::Task> task,
const v8::SourceLocation& location) { … }
void V8ForegroundTaskRunnerWithLocker::PostDelayedTaskImpl(
std::unique_ptr<v8::Task> task,
double delay_in_seconds,
const v8::SourceLocation& location) { … }
void V8ForegroundTaskRunnerWithLocker::PostIdleTaskImpl(
std::unique_ptr<v8::IdleTask> task,
const v8::SourceLocation& location) { … }
bool V8ForegroundTaskRunnerWithLocker::NonNestableTasksEnabled() const { … }
}