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

Unified Diff: src/GlobalJsObject.cpp

Issue 10296001: Implement File API (Closed)
Patch Set: Addressed the new issues Created April 16, 2013, 1:37 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 | « src/GlobalJsObject.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> consoleObject =
+ ConsoleJsObject::Create(errorCallback);
+ global->Set(v8::String::New("console"), consoleObject);
return handleScope.Close(global);
}
« no previous file with comments | « src/GlobalJsObject.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld