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

Unified Diff: src/GlobalJsObject.cpp

Issue 10420020: Made sure FilterEngine instances are always initialized (Closed)
Patch Set: Created May 16, 2013, 2:27 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/FilterEngine.cpp ('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
@@ -79,22 +79,29 @@ namespace
}
timeoutThread->Start();
// We should actually return the timer ID here, which could be
// used via clearTimeout(). But since we don't seem to need
// clearTimeout(), we can save that for later.
return v8::Undefined();
}
+
+ v8::Handle<v8::Value> InitDoneCallback(const v8::Arguments& arguments)
+ {
+ AdblockPlus::JsEngine::FromArguments(arguments)->InitDone();
+ return v8::Undefined();
+ }
}
JsValuePtr GlobalJsObject::Setup(JsEnginePtr jsEngine, const AppInfo& appInfo,
JsValuePtr obj)
{
obj->SetProperty("setTimeout", jsEngine->NewCallback(::SetTimeoutCallback));
+ obj->SetProperty("_initDone", jsEngine->NewCallback(::InitDoneCallback));
obj->SetProperty("_fileSystem",
FileSystemJsObject::Setup(jsEngine, jsEngine->NewObject()));
obj->SetProperty("_webRequest",
WebRequestJsObject::Setup(jsEngine, jsEngine->NewObject()));
obj->SetProperty("console",
ConsoleJsObject::Setup(jsEngine, jsEngine->NewObject()));
obj->SetProperty("_appInfo",
AppInfoJsObject::Setup(jsEngine, appInfo, jsEngine->NewObject()));
« no previous file with comments | « src/FilterEngine.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld