Lines Matching refs:v8
18 #include <v8.h>
41 v8::Persistent<v8::FunctionTemplate> WorkerV8Template;
49 v8::Persistent<v8::Object> js_this;
50 v8::Persistent<v8::Value> value;
77 v8::Persistent<v8::Value> functionValue_;
81 Handler(WorkerV8 *worker, v8::Handle<v8::Value> value)
83 functionValue_ = v8::Persistent<v8::Value>::New(value);
89 v8::Locker locker;
90 v8::HandleScope handle_scope;
91 v8::TryCatch try_catch;
95 v8::Handle<v8::Value> args(ai->value);
96 v8::Function::Cast(*functionValue_)->Call(ai->js_this, 1, &args);
110 WorkerV8(v8::Handle<v8::Object> self, v8::Handle<v8::Value> functionValue) {
123 static v8::Handle<v8::Value> Run(const v8::Arguments& args) {
128 return v8::Undefined();
131 static v8::Handle<v8::Value> Add(const v8::Arguments& args) {
138 return v8::ThrowException(v8::String::New("Add has no parameter"));
141 ai->js_this = v8::Persistent<v8::Object>::New( args.This() );
142 ai->value = v8::Persistent<v8::Value>::New( args[0] );
146 return v8::Undefined();
149 static v8::Handle<v8::Value> AddDelayed(const v8::Arguments& args) {
156 return v8::ThrowException(v8::String::New("AddDelayed expects req delayTime params"));
159 ai->js_this = v8::Persistent<v8::Object>::New( args.This() );
160 ai->value = v8::Persistent<v8::Value>::New( args[0] );
161 v8::Handle<v8::Value> v8DelayMs(args[1]->ToObject());
166 return v8::Undefined();
169 static v8::Handle<v8::Value> NewWorkerV8(const v8::Arguments& args) {
179 v8::HandleScope handle_scope;
181 WorkerV8Template = v8::Persistent<v8::FunctionTemplate>::New(
182 v8::FunctionTemplate::New(WorkerV8::NewWorkerV8));
183 WorkerV8Template->SetClassName(v8::String::New("Worker"));
195 void testWorkerV8(v8::Handle<v8::Context> context) {
197 v8::HandleScope handle_scope;
199 v8::TryCatch try_catch;
220 extern void WorkerV8ObjectTemplateInit(v8::Handle<v8::ObjectTemplate> target) {
222 target->Set(v8::String::New("Worker"), WorkerV8Template);