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

Unified Diff: src/JsEngine.cpp

Issue 10085006: Implement setTimeout (Closed)
Patch Set: Created April 8, 2013, 1:07 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/JsEngine.cpp
===================================================================
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -109,6 +109,19 @@
return *ascii;
}
+std::string AdblockPlus::JsEngine::GetVariable(const std::string& name)
+{
+ const v8::Locker locker(v8::Isolate::GetCurrent());
+ const v8::HandleScope handleScope;
+ const v8::Context::Scope contextScope(context);
+ const v8::Local<v8::Object> global = context->Global();
+ const v8::Local<v8::Value> value = global->Get(v8::String::New(name.c_str()));
+ if (value->IsUndefined())
+ return "";
+ const v8::String::AsciiValue ascii(value);
+ return *ascii;
+}
+
void AdblockPlus::JsEngine::Gc()
{
while (!v8::V8::IdleNotification());
« src/GlobalJsObject.cpp ('K') | « src/GlobalJsObject.cpp ('k') | test/GlobalJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld