Index: include/AdblockPlus/JsEngine.h |
=================================================================== |
--- a/include/AdblockPlus/JsEngine.h |
+++ b/include/AdblockPlus/JsEngine.h |
@@ -19,17 +19,17 @@ namespace AdblockPlus |
const v8::Handle<v8::Message> message); |
}; |
class JsEngine |
{ |
friend class JsValue; |
public: |
- JsEngine(const FileReader* const fileReader, |
+ JsEngine(FileReader* const fileReader, |
WebRequest* const webRequest, |
ErrorCallback* const errorCallback); |
JsValuePtr Evaluate(const std::string& source, |
const std::string& filename = ""); |
void Load(const std::string& scriptPath); |
void Gc(); |
JsValuePtr NewValue(const std::string& val); |
JsValuePtr NewValue(int64_t val); |
@@ -37,29 +37,47 @@ namespace AdblockPlus |
inline JsValuePtr NewValue(const char* val) |
{ |
return NewValue(std::string(val)); |
} |
inline JsValuePtr NewValue(int val) |
{ |
return NewValue((int64_t)val); |
} |
+ JsValuePtr NewObject(); |
+ static JsEngine& FromArguments(const v8::Arguments& arguments); |
+ JsValueList ConvertArguments(const v8::Arguments& arguments); |
+ |
+ inline FileReader& GetFileReader() |
+ { |
+ return fileReader; |
+ } |
+ inline WebRequest& GetWebRequest() |
+ { |
+ return webRequest; |
+ } |
+ inline ErrorCallback& GetErrorCallback() |
+ { |
+ return errorCallback; |
+ } |
class Context |
{ |
public: |
Context(const JsEngine& jsEngine); |
virtual inline ~Context() {}; |
private: |
const v8::Locker locker; |
const v8::HandleScope handleScope; |
const v8::Context::Scope contextScope; |
}; |
private: |
- const FileReader* const fileReader; |
+ FileReader& fileReader; |
+ WebRequest& webRequest; |
+ ErrorCallback& errorCallback; |
v8::Isolate* isolate; |
v8::Persistent<v8::Context> context; |
}; |
} |
#endif |