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

Unified Diff: include/AdblockPlus/JsEngine.h

Issue 10184021: Some refactoring of global JavaScript objects (Closed)
Patch Set: Unbitrotted patch Created April 16, 2013, 3:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsEngine.h
===================================================================
--- a/include/AdblockPlus/JsEngine.h
+++ b/include/AdblockPlus/JsEngine.h
@@ -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 FileSystem& GetFileSystem()
+ {
+ return fileSystem;
+ }
+ 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 FileSystem* const fileSystem;
+ FileSystem& fileSystem;
+ WebRequest& webRequest;
+ ErrorCallback& errorCallback;
v8::Isolate* isolate;
v8::Persistent<v8::Context> context;
};
}
#endif
« no previous file with comments | « no previous file | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld