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

Unified Diff: include/AdblockPlus/JsEngine.h

Issue 29451722: Issue 4907 - Update v8 to 5.7.278 in libadblockplus (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: fix support of ARCH=ia32 Created June 2, 2017, 7:19 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
« README.md ('K') | « dependencies ('k') | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsEngine.h
diff --git a/include/AdblockPlus/JsEngine.h b/include/AdblockPlus/JsEngine.h
index 63f929c94a0b481b33ec3270d50a6ab51408540b..46b0011a09f71d145b152d54d8140239669d2565 100644
--- a/include/AdblockPlus/JsEngine.h
+++ b/include/AdblockPlus/JsEngine.h
@@ -34,12 +34,11 @@
namespace v8
{
- class Arguments;
class Isolate;
class Value;
class Context;
- template<class T> class Handle;
- typedef Handle<Value>(*InvocationCallback)(const Arguments &args);
+ template<typename T> class FunctionCallbackInfo;
+ typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>& info);
}
namespace AdblockPlus
@@ -92,7 +91,7 @@ namespace AdblockPlus
struct JsWeakValuesList
{
~JsWeakValuesList();
- std::vector<std::unique_ptr<v8::Persistent<v8::Value>>> values;
+ std::vector<v8::Global<v8::Value>> values;
};
typedef std::list<JsWeakValuesList> JsWeakValuesLists;
public:
@@ -199,21 +198,21 @@ namespace AdblockPlus
/**
* Creates a JavaScript function that invokes a C++ callback.
* @param callback C++ callback to invoke. The callback receives a
- * `v8::Arguments` object and can use `FromArguments()` to retrieve
+ * `v8::FunctionCallbackInfo` object and can use `FromArguments()` to retrieve
* the current `JsEngine`.
* @return New `JsValue` instance.
*/
- JsValue NewCallback(const v8::InvocationCallback& callback);
+ JsValue NewCallback(const v8::FunctionCallback& callback);
/**
- * Returns a `JsEngine` instance contained in a `v8::Arguments` object.
+ * Returns a `JsEngine` instance contained in a `v8::FunctionCallbackInfo` object.
* Use this in callbacks created via `NewCallback()` to retrieve the current
* `JsEngine`.
- * @param arguments `v8::Arguments` object containing the `JsEngine`
+ * @param arguments `v8::FunctionCallbackInfo` object containing the `JsEngine`
* instance.
- * @return `JsEngine` instance from `v8::Arguments`.
+ * @return `JsEngine` instance from `v8::FunctionCallbackInfo`.
*/
- static JsEnginePtr FromArguments(const v8::Arguments& arguments);
+ static JsEnginePtr FromArguments(const v8::FunctionCallbackInfo<v8::Value>& arguments);
/**
* Stores `JsValue`s in a way they don't keep a strong reference to
@@ -237,25 +236,25 @@ namespace AdblockPlus
/*
* Private functionality required to implement timers.
- * @param arguments `v8::Arguments` is the arguments received in C++
+ * @param arguments `v8::FunctionCallbackInfo` is the arguments received in C++
* callback associated for global setTimeout method.
*/
- static void ScheduleTimer(const v8::Arguments& arguments);
+ static void ScheduleTimer(const v8::FunctionCallbackInfo<v8::Value>& arguments);
/*
* Private functionality required to implement web requests.
- * @param arguments `v8::Arguments` is the arguments received in C++
+ * @param arguments `v8::FunctionCallbackInfo` is the arguments received in C++
* callback associated for global GET method.
*/
- static void ScheduleWebRequest(const v8::Arguments& arguments);
+ static void ScheduleWebRequest(const v8::FunctionCallbackInfo<v8::Value>& arguments);
/**
* Converts v8 arguments to `JsValue` objects.
- * @param arguments `v8::Arguments` object containing the arguments to
+ * @param arguments `v8::FunctionCallbackInfo` object containing the arguments to
* convert.
* @return List of arguments converted to `const JsValue` objects.
*/
- JsValueList ConvertArguments(const v8::Arguments& arguments);
+ JsValueList ConvertArguments(const v8::FunctionCallbackInfo<v8::Value>& arguments);
/**
* @see `SetFileSystem()`.
@@ -325,7 +324,7 @@ namespace AdblockPlus
FileSystemPtr fileSystem;
LogSystemPtr logSystem;
- std::unique_ptr<v8::Persistent<v8::Context>> context;
+ std::unique_ptr<v8::Global<v8::Context>> context;
EventMap eventCallbacks;
std::mutex eventCallbacksMutex;
JsWeakValuesLists jsWeakValuesLists;
« README.md ('K') | « dependencies ('k') | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld