Commit 1b51dca3 authored by tzik's avatar tzik Committed by Commit Bot

Add MicrotasksPolicy parameter on MicrotaskQueue constructor

MicrotasksPolicy was a missing functionality of MicrotaskQueue that
was available on the per-Isolate MicrotaskQueue.
This expose that as a construction time option.

Change-Id: I22bcc8082ca64552d107ee6db138011654047861
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559677Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60858}
parent 4269f23b
......@@ -6768,7 +6768,8 @@ class V8_EXPORT MicrotaskQueue {
/**
* Creates an empty MicrotaskQueue instance.
*/
static std::unique_ptr<MicrotaskQueue> New(Isolate* isolate);
static std::unique_ptr<MicrotaskQueue> New(
Isolate* isolate, MicrotasksPolicy policy = MicrotasksPolicy::kAuto);
virtual ~MicrotaskQueue() = default;
......
......@@ -8935,8 +8935,12 @@ void v8::Isolate::LocaleConfigurationChangeNotification() {
}
// static
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate) {
return i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate,
MicrotasksPolicy policy) {
auto microtask_queue =
i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
microtask_queue->set_microtasks_policy(policy);
return microtask_queue;
}
MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment