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: Created April 12, 2013, 1:23 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
« lib/info.js ('K') | « 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,7 @@
#include <vector>
#include <stdexcept>
+#include "AppInfoJsObject.h"
#include "GlobalJsObject.h"
#include "ConsoleJsObject.h"
#include "WebRequestJsObject.h"
@@ -88,7 +89,7 @@
}
v8::Handle<v8::ObjectTemplate> GlobalJsObject::Create(
- ErrorCallback& errorCallback, WebRequest& webRequest)
+ const AppInfo& appInfo, ErrorCallback& errorCallback, WebRequest& webRequest)
{
const v8::Locker locker(v8::Isolate::GetCurrent());
v8::HandleScope handleScope;
@@ -99,6 +100,8 @@
const v8::Handle<v8::FunctionTemplate> setTimeoutFunction =
v8::FunctionTemplate::New(SetTimeoutCallback);
global->Set(v8::String::New("setTimeout"), setTimeoutFunction);
+ const v8::Handle<v8::ObjectTemplate> info = AppInfoJsObject::Create(appInfo);
+ global->Set(v8::String::New("_appInfo"), info);
const v8::Handle<v8::ObjectTemplate> request =
AdblockPlus::WebRequestJsObject::Create(webRequest);
global->Set(v8::String::New("_webRequest"), request);
« lib/info.js ('K') | « src/GlobalJsObject.h ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld