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

Unified Diff: src/JsValue.cpp

Issue 29410664: Issue 5013 - Use const JsValue and pass reference where applicable (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 12, 2017, 3:24 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
Index: src/JsValue.cpp
===================================================================
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -168,32 +168,37 @@
obj->Set(property, val);
}
v8::Local<v8::Value> AdblockPlus::JsValue::UnwrapValue() const
{
return v8::Local<v8::Value>::New(jsEngine->GetIsolate(), *value);
}
+JsValue AdblockPlus::JsValue::Clone() const
+{
+ return JsValue(jsEngine, UnwrapValue());
+}
+
void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::string& val)
{
const JsContext context(jsEngine);
SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val));
}
void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val)
{
const JsContext context(jsEngine);
SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val));
}
-void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValuePtr& val)
+void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValue& val)
{
const JsContext context(jsEngine);
- SetProperty(name, val->UnwrapValue());
+ SetProperty(name, val.UnwrapValue());
}
void AdblockPlus::JsValue::SetProperty(const std::string& name, bool val)
{
const JsContext context(jsEngine);
SetProperty(name, v8::Boolean::New(val));
}
« src/FilterEngine.cpp ('K') | « src/JsEngine.cpp ('k') | src/WebRequestJsObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld