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

Unified Diff: include/AdblockPlus/JsValue.h

Issue 29364548: Issue 4188 - Update libadblockplus-android to use the latest libadblockplus (Closed)
Patch Set: recompiled for libadblockplus git:70ac2462a5e6437b5b1f58455b2e0172c33cc432. Duplicated on gihtub: https://github.com/4ntoine/libadblockplus-binaries/commit/5b9c89920c72f0b980a268bc80b73705c29a034a Created Dec. 5, 2016, 11:20 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
Index: include/AdblockPlus/JsValue.h
diff --git a/include/AdblockPlus/JsValue.h b/include/AdblockPlus/JsValue.h
index fb76efff6f475b83c93175f3e52c17897b89874a..c9632149822fe9d5d44ef06efc2ef1caa0555613 100644
--- a/include/AdblockPlus/JsValue.h
+++ b/include/AdblockPlus/JsValue.h
@@ -1,6 +1,6 @@
/*
* This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
+ * Copyright (C) 2006-2016 Eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -22,13 +22,13 @@
#include <string>
#include <vector>
#include <memory>
-#include "V8ValueHolder.h"
namespace v8
{
class Value;
template<class T> class Handle;
template<class T> class Local;
+ template<class T> class Persistent;
}
namespace AdblockPlus
@@ -56,6 +56,7 @@ namespace AdblockPlus
{
friend class JsEngine;
public:
+ JsValue(JsValue&& src);
virtual ~JsValue();
bool IsUndefined() const;
@@ -123,14 +124,21 @@ namespace AdblockPlus
JsValuePtr Call(const JsValueList& params = JsValueList(),
AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const;
+ /**
+ * Invokes the value as a function (see `IsFunction()`) with single
+ * parameter.
+ * @param arg A single required parameter.
+ * @return Value returned by the function.
+ */
+ JsValuePtr Call(const JsValue& arg) const;
+
v8::Local<v8::Value> UnwrapValue() const;
protected:
- JsValue(JsValuePtr value);
JsEnginePtr jsEngine;
private:
JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
- V8ValueHolder<v8::Value> value;
+ std::unique_ptr<v8::Persistent<v8::Value>> value;
};
}

Powered by Google App Engine
This is Rietveld