Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsContext.h

Issue 29377060: Noissue - add JsLocker which is merely v8::Locker but can be used with our JsEngine. (Closed)
Patch Set: Created Feb. 28, 2017, 12:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/JsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsContext.h
diff --git a/src/JsContext.h b/src/JsContext.h
index 1a00107d0662d5fb8e86b68d20447703c29925d5..605ed8bf2b5b0048a67eb480a6c88914a0a5c9dc 100644
--- a/src/JsContext.h
+++ b/src/JsContext.h
@@ -23,10 +23,17 @@
namespace AdblockPlus
{
+ class JsLocker {
Oleksandr 2017/02/28 15:36:02 Nit: JsLocker is pretty ambivalent. How about JsEn
Eric 2017/02/28 16:26:44 I've been deep in this code, and I don't see why t
Oleksandr 2017/02/28 17:33:56 To clarify, this looks good to me, provided this i
sergei 2017/02/28 22:14:48 I used it to synchronize access to JsEngine::isCon
+ public:
+ explicit JsLocker(const JsEnginePtr& jsEngine);
+ private:
+ const v8::Locker locker;
+ };
+
class JsContext
{
public:
- explicit JsContext(const JsEnginePtr jsEngine);
+ explicit JsContext(const JsEnginePtr& jsEngine);
Eric 2017/02/28 16:26:44 Changing this API signature is not documented in t
sergei 2017/02/28 22:14:48 It seems to be the reason you are always missing c
v8::Local<v8::Context> GetV8Context() const
{
@@ -34,7 +41,7 @@ namespace AdblockPlus
}
private:
- const v8::Locker locker;
+ const JsLocker locker;
const v8::Isolate::Scope isolateScope;
const v8::HandleScope handleScope;
const v8::Local<v8::Context> context;
« no previous file with comments | « no previous file | src/JsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld