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

Unified Diff: src/FilterEngine.cpp

Issue 29361562: Issue 3594 - remove circular references JsEngine-JsValue-JsEngine (Closed)
Patch Set: address comments Created Nov. 25, 2016, 12:02 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 | « src/FileSystemJsObject.cpp ('k') | src/JsContext.h » ('j') | src/JsValue.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
diff --git a/src/FilterEngine.cpp b/src/FilterEngine.cpp
index 9b5662a052a0d81444bb40a93d80c0823d0242e6..20f07535a82641cda4bc6b50cf9215008dcc370a 100644
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -54,7 +54,8 @@ Filter::Type Filter::GetType()
bool Filter::IsListed()
{
- JsValuePtr func = jsEngine->Evaluate("API.isListedFilter");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.isListedFilter");
JsValueList params;
params.push_back(shared_from_this());
return func->Call(params)->AsBool();
@@ -62,7 +63,8 @@ bool Filter::IsListed()
void Filter::AddToList()
{
- JsValuePtr func = jsEngine->Evaluate("API.addFilterToList");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.addFilterToList");
JsValueList params;
params.push_back(shared_from_this());
func->Call(params);
@@ -70,7 +72,8 @@ void Filter::AddToList()
void Filter::RemoveFromList()
{
- JsValuePtr func = jsEngine->Evaluate("API.removeFilterFromList");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.removeFilterFromList");
JsValueList params;
params.push_back(shared_from_this());
func->Call(params);
@@ -90,7 +93,8 @@ Subscription::Subscription(JsValue&& value)
bool Subscription::IsListed()
{
- JsValuePtr func = jsEngine->Evaluate("API.isListedSubscription");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.isListedSubscription");
JsValueList params;
params.push_back(shared_from_this());
return func->Call(params)->AsBool();
@@ -98,7 +102,8 @@ bool Subscription::IsListed()
void Subscription::AddToList()
{
- JsValuePtr func = jsEngine->Evaluate("API.addSubscriptionToList");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.addSubscriptionToList");
JsValueList params;
params.push_back(shared_from_this());
func->Call(params);
@@ -106,7 +111,8 @@ void Subscription::AddToList()
void Subscription::RemoveFromList()
{
- JsValuePtr func = jsEngine->Evaluate("API.removeSubscriptionFromList");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.removeSubscriptionFromList");
JsValueList params;
params.push_back(shared_from_this());
func->Call(params);
@@ -114,7 +120,8 @@ void Subscription::RemoveFromList()
void Subscription::UpdateFilters()
{
- JsValuePtr func = jsEngine->Evaluate("API.updateSubscription");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.updateSubscription");
JsValueList params;
params.push_back(shared_from_this());
func->Call(params);
@@ -122,7 +129,8 @@ void Subscription::UpdateFilters()
bool Subscription::IsUpdating()
{
- JsValuePtr func = jsEngine->Evaluate("API.isSubscriptionUpdating");
+ JsContext context(jsEngine);
+ JsValuePtr func = context.GetJsEngine().Evaluate("API.isSubscriptionUpdating");
JsValueList params;
params.push_back(shared_from_this());
JsValuePtr result = func->Call(params);
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsContext.h » ('j') | src/JsValue.cpp » ('J')

Powered by Google App Engine
This is Rietveld