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

Unified Diff: src/GlobalJsObject.cpp

Issue 10198022: Pass application data into libadblockplus (Closed)
Patch Set: Merged upstream, addressed issues, renamed AppInfo fields Created April 17, 2013, 2:47 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
@@ -3,6 +3,8 @@
#include <AdblockPlus/JsEngine.h>
#include <AdblockPlus/JsValue.h>
+
+#include "AppInfoJsObject.h"
#include "ConsoleJsObject.h"
#include "FileSystemJsObject.h"
#include "GlobalJsObject.h"
@@ -69,7 +71,7 @@
}
v8::Handle<v8::ObjectTemplate> GlobalJsObject::Create(
- JsEngine& jsEngine)
+ const AppInfo& appInfo, JsEngine& jsEngine)
{
const v8::Locker locker(v8::Isolate::GetCurrent());
v8::HandleScope handleScope;
@@ -87,5 +89,8 @@
const v8::Handle<v8::ObjectTemplate> consoleObject =
ConsoleJsObject::Create(jsEngine);
global->Set(v8::String::New("console"), consoleObject);
+ const v8::Handle<v8::ObjectTemplate> appInfoObject =
+ AppInfoJsObject::Create(appInfo);
+ global->Set(v8::String::New("_appInfo"), appInfoObject);
return handleScope.Close(global);
}
« src/AppInfoJsObject.cpp ('K') | « src/GlobalJsObject.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld