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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 11 matching lines...) Expand all Loading... |
22 #include <map> | 22 #include <map> |
23 #include <stdexcept> | 23 #include <stdexcept> |
24 #include <stdint.h> | 24 #include <stdint.h> |
25 #include <string> | 25 #include <string> |
26 #include <AdblockPlus/AppInfo.h> | 26 #include <AdblockPlus/AppInfo.h> |
27 #include <AdblockPlus/LogSystem.h> | 27 #include <AdblockPlus/LogSystem.h> |
28 #include <AdblockPlus/FileSystem.h> | 28 #include <AdblockPlus/FileSystem.h> |
29 #include <AdblockPlus/JsValue.h> | 29 #include <AdblockPlus/JsValue.h> |
30 #include <AdblockPlus/WebRequest.h> | 30 #include <AdblockPlus/WebRequest.h> |
31 | 31 |
32 #include "V8ValueHolder.h" | |
33 | |
34 namespace v8 | 32 namespace v8 |
35 { | 33 { |
36 class Arguments; | 34 class Arguments; |
37 class Isolate; | 35 class Isolate; |
38 class Value; | 36 class Value; |
39 class Context; | 37 class Context; |
40 template<class T> class Handle; | 38 template<class T> class Handle; |
41 typedef Handle<Value>(*InvocationCallback)(const Arguments &args); | 39 typedef Handle<Value>(*InvocationCallback)(const Arguments &args); |
42 } | 40 } |
43 | 41 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 */ | 215 */ |
218 void SetGlobalProperty(const std::string& name, AdblockPlus::JsValuePtr valu
e); | 216 void SetGlobalProperty(const std::string& name, AdblockPlus::JsValuePtr valu
e); |
219 | 217 |
220 private: | 218 private: |
221 JsEngine(); | 219 JsEngine(); |
222 | 220 |
223 FileSystemPtr fileSystem; | 221 FileSystemPtr fileSystem; |
224 WebRequestPtr webRequest; | 222 WebRequestPtr webRequest; |
225 LogSystemPtr logSystem; | 223 LogSystemPtr logSystem; |
226 v8::Isolate* isolate; | 224 v8::Isolate* isolate; |
227 V8ValueHolder<v8::Context> context; | 225 std::unique_ptr<v8::Persistent<v8::Context>> context; |
228 EventMap eventCallbacks; | 226 EventMap eventCallbacks; |
229 JsValuePtr globalJsObject; | 227 JsValuePtr globalJsObject; |
230 }; | 228 }; |
231 } | 229 } |
232 | 230 |
233 #endif | 231 #endif |
OLD | NEW |