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

Unified Diff: gin/isolate_holder.cc

Issue 1100743004: Adding field to tell if gin::IsolateHolder needs lock to be accessed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discardable
Patch Set: Created 5 years, 8 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') | gin/public/isolate_holder.h » ('J')
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 9ef41d374a0625296ab82a5e02b995ffc9383274..60a1f8b2c33d20b70ec08cfc3f56ba7b4043f392 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -22,7 +22,10 @@ namespace {
v8::ArrayBuffer::Allocator* g_array_buffer_allocator = nullptr;
} // namespace
-IsolateHolder::IsolateHolder() {
+IsolateHolder::IsolateHolder() : IsolateHolder(LockMode::kDirectAccess) {
+}
+
+IsolateHolder::IsolateHolder(LockMode lock_mode) : lock_mode_(lock_mode) {
v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first";
v8::Isolate::CreateParams params;
@@ -84,4 +87,8 @@ void IsolateHolder::RemoveRunMicrotasksObserver() {
task_observer_.reset();
}
+bool IsolateHolder::UseLock() {
Primiano Tucci (use gerrit) 2015/04/23 15:52:40 At this point, since you introduced an enum, I'd j
ssid 2015/04/23 16:24:56 Done.
+ return lock_mode_ == LockMode::kLockToAccess;
+}
+
} // namespace gin
« no previous file with comments | « no previous file | gin/public/isolate_holder.h » ('j') | gin/public/isolate_holder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698