Index: include/AdblockPlus/JsValue.h |
=================================================================== |
--- a/include/AdblockPlus/JsValue.h |
+++ b/include/AdblockPlus/JsValue.h |
@@ -28,6 +28,7 @@ |
{ |
class Value; |
template<class T> class Handle; |
+ template<class T> class Local; |
} |
namespace AdblockPlus |
@@ -54,8 +55,9 @@ |
class JsValue |
{ |
friend class JsEngine; |
+ protected: |
+ JsValue(const JsValuePtr& value); |
public: |
- JsValue(JsValuePtr value); |
virtual ~JsValue(); |
bool IsUndefined() const; |
@@ -94,7 +96,7 @@ |
void SetProperty(const std::string& name, const std::string& val); |
void SetProperty(const std::string& name, int64_t val); |
void SetProperty(const std::string& name, bool val); |
- void SetProperty(const std::string& name, JsValuePtr value); |
+ void SetProperty(const std::string& name, const JsValuePtr& value); |
inline void SetProperty(const std::string& name, const char* val) |
{ |
SetProperty(name, std::string(val)); |
@@ -123,11 +125,13 @@ |
JsValuePtr Call(const JsValueList& params = JsValueList(), |
AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const; |
+ v8::Local<v8::Value> UnwrapValue() const; |
+ private: |
+ JsValue(const JsEnginePtr& jsEngine, v8::Handle<v8::Value> value); |
+ void SetProperty(const std::string& name, v8::Handle<v8::Value> val); |
protected: |
- JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value); |
- void SetProperty(const std::string& name, v8::Handle<v8::Value> val); |
- |
JsEnginePtr jsEngine; |
+ private: |
Wladimir Palant
2014/11/01 22:30:25
Nit: Why not merge the two private sections?
sergei
2014/11/03 12:58:19
merged
|
V8ValueHolder<v8::Value> value; |
}; |
} |