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

Delta Between Two Patch Sets: include/AdblockPlus/JsEngine.h

Issue 10085006: Implement setTimeout (Closed)
Left Patch Set: Created April 5, 2013, 3:49 p.m.
Right Patch Set: Created April 8, 2013, 1:07 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/compat.js » ('j') | src/GlobalJsObject.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 ErrorCallback; 10 class ErrorCallback;
11 class FileReader; 11 class FileReader;
12 12
13 class JsError : public std::runtime_error 13 class JsError : public std::runtime_error
14 { 14 {
15 public: 15 public:
16 explicit JsError(const v8::Handle<v8::Value> exception, 16 explicit JsError(const v8::Handle<v8::Value> exception,
17 const v8::Handle<v8::Message> message); 17 const v8::Handle<v8::Message> message);
18 }; 18 };
19 19
20 class JsEngine 20 class JsEngine
21 { 21 {
22 public: 22 public:
23 JsEngine(const FileReader* const fileReader, 23 JsEngine(const FileReader* const fileReader,
24 ErrorCallback* const errorCallback); 24 ErrorCallback* const errorCallback);
25 void Evaluate(const char* source, const char* filename = NULL); 25 void Evaluate(const char* source, const char* filename = NULL);
26 void Evaluate(const std::string& source, 26 void Evaluate(const std::string& source,
27 const std::string& filename = ""); 27 const std::string& filename = "");
28 void Load(const std::string& scriptPath); 28 void Load(const std::string& scriptPath);
29 std::string Call(const std::string& functionName); 29 std::string Call(const std::string& functionName);
30 std::string GetGlobal(const std::string& name); 30 std::string GetVariable(const std::string& name);
31 void Gc(); 31 void Gc();
32 32
33 private: 33 private:
34 const FileReader* const fileReader; 34 const FileReader* const fileReader;
35 v8::Persistent<v8::Context> context; 35 v8::Persistent<v8::Context> context;
36 }; 36 };
37 } 37 }
38 38
39 #endif 39 #endif
LEFTRIGHT
« no previous file | lib/compat.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld