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

Unified Diff: include/AdblockPlus/JsValue.h

Issue 29334678: Issue 3589 - Change return type of AdblockPlus::JsValue::Call from pointer to r-value object. (Closed)
Patch Set: rebase Created March 27, 2017, 9:47 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 | « no previous file | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsValue.h
diff --git a/include/AdblockPlus/JsValue.h b/include/AdblockPlus/JsValue.h
index da68d8fb9e17bb796622baa401cdbdcbb1326fb3..a7ca34c0915329fa045c379611e87abba6e5a7af 100644
--- a/include/AdblockPlus/JsValue.h
+++ b/include/AdblockPlus/JsValue.h
@@ -26,6 +26,7 @@
namespace v8
{
class Value;
+ class Object;
template<class T> class Handle;
template<class T> class Local;
template<class T> class Persistent;
@@ -123,7 +124,7 @@ namespace AdblockPlus
* @param thisPtr Optional `this` value.
* @return Value returned by the function.
*/
- JsValuePtr Call(const JsConstValueList& params = JsConstValueList(),
+ JsValue Call(const JsConstValueList& params = JsConstValueList(),
AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const;
/**
@@ -132,7 +133,7 @@ namespace AdblockPlus
* @param arg A single required parameter.
* @return Value returned by the function.
*/
- JsValuePtr Call(const JsConstValuePtr& arg) const;
+ JsValue Call(const JsValue& arg) const;
v8::Local<v8::Value> UnwrapValue() const;
protected:
@@ -140,6 +141,10 @@ namespace AdblockPlus
private:
JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
+ // Parameter args is not const because a pointer to its internal arrays is
+ // passed to v8::Function::Call but the latter does not expect a const pointer.
+ JsValue Call(std::vector<v8::Handle<v8::Value>>& args, v8::Local<v8::Object> thisObj) const;
+
std::unique_ptr<v8::Persistent<v8::Value>> value;
};
}
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld