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

Unified Diff: src/JsContext.cpp

Issue 29361562: Issue 3594 - remove circular references JsEngine-JsValue-JsEngine (Closed)
Patch Set: address comments Created Nov. 29, 2016, 10:45 a.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 | « src/JsContext.h ('k') | src/JsValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsContext.cpp
diff --git a/src/JsContext.cpp b/src/JsContext.cpp
index dd8faf6ff4b8c765a18831ebd5dee6d377db7bef..bd2916a4a176f19d25fcc81147c7c7c54c93a1dc 100644
--- a/src/JsContext.cpp
+++ b/src/JsContext.cpp
@@ -16,10 +16,13 @@
*/
#include "JsContext.h"
+#include "Utils.h"
-AdblockPlus::JsContext::JsContext(const JsEnginePtr jsEngine)
- : locker(jsEngine->GetIsolate()), isolateScope(jsEngine->GetIsolate()),
- handleScope(jsEngine->GetIsolate()),
- contextScope(v8::Local<v8::Context>::New(jsEngine->GetIsolate(), *jsEngine->context))
+AdblockPlus::JsContext::JsContext(const std::weak_ptr<JsEngine>& jsEngineArg)
+ : jsEngine(Utils::lockJsEngine(jsEngineArg))
+ , locker(jsEngine->GetIsolate())
+ , isolateScope(jsEngine->GetIsolate())
+ , handleScope(jsEngine->GetIsolate())
+ , contextScope(v8::Local<v8::Context>::New(jsEngine->GetIsolate(), *jsEngine->context))
{
}
« no previous file with comments | « src/JsContext.h ('k') | src/JsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld