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

Side by Side Diff: include/AdblockPlus/JsEngine.h

Issue 10305024: Simplify context setup, set properties on the global object directly instead of using templates (Closed)
Patch Set: Unbitrotted patch Created April 18, 2013, 11:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/AppInfoJsObject.h » ('j') | src/GlobalJsObject.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <AdblockPlus/JsValue.h> 7 #include <AdblockPlus/JsValue.h>
8 8
9 namespace AdblockPlus 9 namespace AdblockPlus
10 { 10 {
(...skipping 27 matching lines...) Expand all
38 JsValuePtr NewValue(bool val); 38 JsValuePtr NewValue(bool val);
39 inline JsValuePtr NewValue(const char* val) 39 inline JsValuePtr NewValue(const char* val)
40 { 40 {
41 return NewValue(std::string(val)); 41 return NewValue(std::string(val));
42 } 42 }
43 inline JsValuePtr NewValue(int val) 43 inline JsValuePtr NewValue(int val)
44 { 44 {
45 return NewValue(static_cast<int64_t>(val)); 45 return NewValue(static_cast<int64_t>(val));
46 } 46 }
47 JsValuePtr NewObject(); 47 JsValuePtr NewObject();
48 JsValuePtr NewCallback(v8::InvocationCallback callback);
48 static JsEngine& FromArguments(const v8::Arguments& arguments); 49 static JsEngine& FromArguments(const v8::Arguments& arguments);
49 JsValueList ConvertArguments(const v8::Arguments& arguments); 50 JsValueList ConvertArguments(const v8::Arguments& arguments);
50 51
51 inline FileSystem& GetFileSystem() 52 inline FileSystem& GetFileSystem()
52 { 53 {
53 return fileSystem; 54 return fileSystem;
54 } 55 }
55 inline WebRequest& GetWebRequest() 56 inline WebRequest& GetWebRequest()
56 { 57 {
57 return webRequest; 58 return webRequest;
(...skipping 18 matching lines...) Expand all
76 private: 77 private:
77 FileSystem& fileSystem; 78 FileSystem& fileSystem;
78 WebRequest& webRequest; 79 WebRequest& webRequest;
79 ErrorCallback& errorCallback; 80 ErrorCallback& errorCallback;
80 v8::Isolate* isolate; 81 v8::Isolate* isolate;
81 v8::Persistent<v8::Context> context; 82 v8::Persistent<v8::Context> context;
82 }; 83 };
83 } 84 }
84 85
85 #endif 86 #endif
OLDNEW
« no previous file with comments | « no previous file | src/AppInfoJsObject.h » ('j') | src/GlobalJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld