Index: src/GlobalJsObject.cpp |
=================================================================== |
--- a/src/GlobalJsObject.cpp |
+++ b/src/GlobalJsObject.cpp |
@@ -1,6 +1,8 @@ |
#include <vector> |
#include <stdexcept> |
+#include "ConsoleJsObject.h" |
+#include "FileSystemJsObject.h" |
#include "GlobalJsObject.h" |
#include "ConsoleJsObject.h" |
#include "WebRequestJsObject.h" |
@@ -88,19 +90,22 @@ |
} |
v8::Handle<v8::ObjectTemplate> GlobalJsObject::Create( |
- ErrorCallback& errorCallback, WebRequest& webRequest) |
+ FileSystem& fileSystem, WebRequest& webRequest, ErrorCallback& errorCallback) |
{ |
const v8::Locker locker(v8::Isolate::GetCurrent()); |
v8::HandleScope handleScope; |
const v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); |
- const v8::Handle<v8::ObjectTemplate> console = |
- AdblockPlus::ConsoleJsObject::Create(errorCallback); |
- global->Set(v8::String::New("console"), console); |
const v8::Handle<v8::FunctionTemplate> setTimeoutFunction = |
v8::FunctionTemplate::New(SetTimeoutCallback); |
global->Set(v8::String::New("setTimeout"), setTimeoutFunction); |
- const v8::Handle<v8::ObjectTemplate> request = |
- AdblockPlus::WebRequestJsObject::Create(webRequest); |
- global->Set(v8::String::New("_webRequest"), request); |
+ const v8::Handle<v8::ObjectTemplate> fileSystemObject = |
+ FileSystemJsObject::Create(fileSystem); |
+ global->Set(v8::String::New("_fileSystem"), fileSystemObject); |
+ const v8::Handle<v8::ObjectTemplate> webRequestObject = |
+ WebRequestJsObject::Create(webRequest); |
+ global->Set(v8::String::New("_webRequest"), webRequestObject); |
+ const v8::Handle<v8::ObjectTemplate> console = |
+ ConsoleJsObject::Create(errorCallback); |
+ global->Set(v8::String::New("console"), console); |
return handleScope.Close(global); |
} |