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

Unified Diff: src/JsContext.h

Issue 29361562: Issue 3594 - remove circular references JsEngine-JsValue-JsEngine (Closed)
Patch Set: Created Nov. 3, 2016, 11:26 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
Index: src/JsContext.h
diff --git a/src/JsContext.h b/src/JsContext.h
index 3a3f2db7fde5028ac1efc09760f98dde7d3b7b26..434b647e3b694c12ce781fd46e3f97906e912fbb 100644
--- a/src/JsContext.h
+++ b/src/JsContext.h
@@ -26,13 +26,16 @@ namespace AdblockPlus
class JsContext
{
public:
- explicit JsContext(const JsEnginePtr jsEngine);
-
+ explicit JsContext(const std::weak_ptr<JsEngine>& jsEngine);
+ JsEngine& jsEngine() {
Oleksandr 2016/11/25 10:38:04 Nit: Methods usually start with a capital letter:
sergei 2016/11/25 12:04:46 Done.
+ return *m_jsEngine;
+ }
private:
- const v8::Locker locker;
- const v8::Isolate::Scope isolateScope;
- const v8::HandleScope handleScope;
- const v8::Context::Scope contextScope;
+ JsEnginePtr m_jsEngine;
+ const v8::Locker m_locker;
+ const v8::Isolate::Scope m_isolateScope;
+ const v8::HandleScope m_handleScope;
+ const v8::Context::Scope m_contextScope;
};
}

Powered by Google App Engine
This is Rietveld