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

Unified Diff: gin/public/isolate_holder.h

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
Index: gin/public/isolate_holder.h
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index ba75cd8f11654f653806776be1c750acd78e75a5..97719f82f45163c80626ecfdc6a77e8ea25508d8 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -27,7 +27,14 @@ class GIN_EXPORT IsolateHolder {
kStrictMode
};
+ // Stores wheather the client uses v8::Locker to access the isolate.
rmcilroy 2015/04/23 15:52:51 /s/wheather/whether
ssid 2015/04/23 16:24:56 Done.
+ enum LockMode {
+ kLockToAccess,
Primiano Tucci (use gerrit) 2015/04/23 15:52:40 I'd probably do: enum AccessMode { kSingleThrea
ssid 2015/04/23 16:24:56 Done.
+ kDirectAccess
+ };
+
IsolateHolder();
+ IsolateHolder(LockMode lock_mode);
~IsolateHolder();
// Should be invoked once before creating IsolateHolder instances to
@@ -52,10 +59,14 @@ class GIN_EXPORT IsolateHolder {
// thread.
void RemoveRunMicrotasksObserver();
+ // This method returns if v8::Locker is needed to access isolate.
+ bool UseLock();
Primiano Tucci (use gerrit) 2015/04/23 15:52:40 UseLock is a bit confusing as a name as it is not
ssid 2015/04/23 16:24:56 Done.
+
private:
v8::Isolate* isolate_;
scoped_ptr<PerIsolateData> isolate_data_;
scoped_ptr<RunMicrotasksObserver> task_observer_;
+ LockMode lock_mode_;
DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
};

Powered by Google App Engine
This is Rietveld 408576698