Left: | ||
Right: |
OLD | NEW |
---|---|
1 #ifndef ADBLOCKPLUS_JS_ENGINE_H | 1 #ifndef ADBLOCKPLUS_JS_ENGINE_H |
2 #define ADBLOCKPLUS_JS_ENGINE_H | 2 #define ADBLOCKPLUS_JS_ENGINE_H |
3 | 3 |
4 #include <stdexcept> | 4 #include <stdexcept> |
5 #include <string> | 5 #include <string> |
6 #include <v8.h> | 6 #include <v8.h> |
7 | 7 |
8 namespace AdblockPlus | 8 namespace AdblockPlus |
9 { | 9 { |
10 class FileSystem; | |
11 class WebRequest; | |
10 class ErrorCallback; | 12 class ErrorCallback; |
11 class FileReader; | |
12 class WebRequest; | |
13 | 13 |
14 class JsError : public std::runtime_error | 14 class JsError : public std::runtime_error |
15 { | 15 { |
16 public: | 16 public: |
17 explicit JsError(const v8::Handle<v8::Value> exception, | 17 explicit JsError(const v8::Handle<v8::Value> exception, |
18 const v8::Handle<v8::Message> message); | 18 const v8::Handle<v8::Message> message); |
19 }; | 19 }; |
20 | 20 |
21 class JsEngine | 21 class JsEngine |
22 { | 22 { |
23 public: | 23 public: |
24 JsEngine(const FileReader* const fileReader, | 24 JsEngine(FileSystem* const fileReader, |
25 WebRequest* const webRequest, | 25 WebRequest* const webRequest, |
26 ErrorCallback* const errorCallback); | 26 ErrorCallback* const errorCallback); |
27 std::string Evaluate(const std::string& source, | 27 std::string Evaluate(const std::string& source, |
28 const std::string& filename = ""); | 28 const std::string& filename = ""); |
29 void Load(const std::string& scriptPath); | 29 void Load(const std::string& scriptPath); |
30 void Gc(); | 30 void Gc(); |
31 | 31 |
32 private: | 32 private: |
33 const FileReader* const fileReader; | 33 const FileSystem* const fileSystem; |
Wladimir Palant
2013/04/12 16:10:35
Do we still need that variable? It's only being us
Felix Dahlke
2013/04/15 03:43:34
Wasn't aware that Load was unused. Yeah, we should
| |
34 v8::Persistent<v8::Context> context; | 34 v8::Persistent<v8::Context> context; |
35 }; | 35 }; |
36 } | 36 } |
37 | 37 |
38 #endif | 38 #endif |
OLD | NEW |