OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 */ | 185 */ |
186 JsValuePtr NewObject(); | 186 JsValuePtr NewObject(); |
187 | 187 |
188 /** | 188 /** |
189 * Creates a JavaScript function that invokes a C++ callback. | 189 * Creates a JavaScript function that invokes a C++ callback. |
190 * @param callback C++ callback to invoke. The callback receives a | 190 * @param callback C++ callback to invoke. The callback receives a |
191 * `v8::Arguments` object and can use `FromArguments()` to retrieve | 191 * `v8::Arguments` object and can use `FromArguments()` to retrieve |
192 * the current `JsEngine`. | 192 * the current `JsEngine`. |
193 * @return New `JsValue` instance. | 193 * @return New `JsValue` instance. |
194 */ | 194 */ |
195 JsValuePtr NewCallback(const v8::InvocationCallback& callback); | 195 JsValue NewCallback(const v8::InvocationCallback& callback); |
196 | 196 |
197 /** | 197 /** |
198 * Returns a `JsEngine` instance contained in a `v8::Arguments` object. | 198 * Returns a `JsEngine` instance contained in a `v8::Arguments` object. |
199 * Use this in callbacks created via `NewCallback()` to retrieve the current | 199 * Use this in callbacks created via `NewCallback()` to retrieve the current |
200 * `JsEngine`. | 200 * `JsEngine`. |
201 * @param arguments `v8::Arguments` object containing the `JsEngine` | 201 * @param arguments `v8::Arguments` object containing the `JsEngine` |
202 * instance. | 202 * instance. |
203 * @return `JsEngine` instance from `v8::Arguments`. | 203 * @return `JsEngine` instance from `v8::Arguments`. |
204 */ | 204 */ |
205 static JsEnginePtr FromArguments(const v8::Arguments& arguments); | 205 static JsEnginePtr FromArguments(const v8::Arguments& arguments); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 EventMap eventCallbacks; | 311 EventMap eventCallbacks; |
312 std::mutex eventCallbacksMutex; | 312 std::mutex eventCallbacksMutex; |
313 mutable std::mutex isConnectionAllowedMutex; | 313 mutable std::mutex isConnectionAllowedMutex; |
314 IsConnectionAllowedCallback isConnectionAllowed; | 314 IsConnectionAllowedCallback isConnectionAllowed; |
315 TimerTasks timerTasks; | 315 TimerTasks timerTasks; |
316 TimerPtr timer; | 316 TimerPtr timer; |
317 }; | 317 }; |
318 } | 318 } |
319 | 319 |
320 #endif | 320 #endif |
OLD | NEW |