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

Unified Diff: src/GlobalJsObject.cpp

Issue 10008015: Move global JS object creation to a separate namespace (Closed)
Patch Set: Created April 3, 2013, 12:33 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
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/GlobalJsObject.cpp
@@ -0,0 +1,14 @@
+#include "GlobalJsObject.h"
+
+using namespace AdblockPlus;
+
+v8::Handle<v8::ObjectTemplate> GlobalJsObject::Create(
+ ErrorCallback& errorCallback)
+{
+ 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);
+ 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