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: Fixed comment Created April 13, 2017, 3:45 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/JsEngine.cpp ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsValue.cpp
===================================================================
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -168,16 +168,21 @@
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)
{
« no previous file with comments | « src/JsEngine.cpp ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld