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

Unified Diff: src/GlobalJsObject.cpp

Issue 10296001: Implement File API (Closed)
Patch Set: Don't pass a blog to _fileSystem.write Created April 12, 2013, 12:10 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
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 =
Wladimir Palant 2013/04/12 16:10:35 console => consoleObject for consistency?
Felix Dahlke 2013/04/15 03:43:34 Agreed.
+ ConsoleJsObject::Create(errorCallback);
+ global->Set(v8::String::New("console"), console);
return handleScope.Close(global);
}

Powered by Google App Engine
This is Rietveld