Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: gin/isolate_holder.cc

Issue 2660423003: Atomics.wait throws when called on the main thread. (Closed)
Patch Set: nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gin/public/isolate_holder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/isolate_holder.cc
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index e38190c4285dd49997452b6336b61c0518fcc9f4..637b488847205edea3b2acc344101c3649a8d6c2 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -34,6 +34,14 @@ IsolateHolder::IsolateHolder(
IsolateHolder::IsolateHolder(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
AccessMode access_mode)
+ : IsolateHolder(std::move(task_runner),
+ AccessMode::kSingleThread,
+ kAllowAtomicsWait) {}
+
+IsolateHolder::IsolateHolder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ AccessMode access_mode,
+ AllowAtomicsWaitMode atomics_wait_mode)
: access_mode_(access_mode) {
v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first";
@@ -43,6 +51,7 @@ IsolateHolder::IsolateHolder(
params.constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(),
base::SysInfo::AmountOfVirtualMemory());
params.array_buffer_allocator = allocator;
+ params.allow_atomics_wait = atomics_wait_mode == kAllowAtomicsWait;
isolate_ = v8::Isolate::New(params);
isolate_data_.reset(
new PerIsolateData(isolate_, allocator, access_mode, task_runner));
« no previous file with comments | « no previous file | gin/public/isolate_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698