Lines Matching refs:v8

117     : public v8::String::ExternalOneByteStringResource {
154 std::string V8StringToUTF8(v8::Handle<v8::String> s) { in V8StringToUTF8()
161 std::u16string V8StringToUTF16(v8::Handle<v8::String> s) { in V8StringToUTF16()
171 v8::Local<v8::String> ASCIIStringToV8String(v8::Isolate* isolate, const std::string& s) { in ASCIIStringToV8String()
172 return v8::String::NewFromUtf8(isolate, s.data(), v8::String::kNormalString, s.size()); in ASCIIStringToV8String()
175 v8::Local<v8::String> UTF16StringToV8String(v8::Isolate* isolate, const std::u16string& s) { in UTF16StringToV8String()
176 return v8::String::NewFromTwoByte( in UTF16StringToV8String()
178 v8::String::kNormalString, s.size()); in UTF16StringToV8String()
182 v8::Local<v8::String> ASCIILiteralToV8String(v8::Isolate* isolate, const char* ascii) { in ASCIILiteralToV8String()
186 return v8::String::NewFromUtf8(isolate, ascii, v8::String::kNormalString, length); in ASCIILiteralToV8String()
187 return v8::String::NewExternal(isolate, new V8ExternalASCIILiteral(ascii, length)); in ASCIILiteralToV8String()
192 bool V8ObjectToUTF8String(v8::Handle<v8::Value> object, in V8ObjectToUTF8String()
194 v8::Isolate* isolate) { in V8ObjectToUTF8String()
198 v8::HandleScope scope(isolate); in V8ObjectToUTF8String()
199 v8::Local<v8::String> str_object = object->ToString(); in V8ObjectToUTF8String()
208 bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args, std::string* hostname) { in GetHostnameArgument()
344 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
360 ProxyErrorListener* error_listener, v8::Isolate* isolate) in Context()
365 v8::Locker locked(isolate_); in ~Context()
366 v8::Isolate::Scope isolate_scope(isolate_); in ~Context()
374 v8::Locker locked(isolate_); in ResolveProxy()
375 v8::Isolate::Scope isolate_scope(isolate_); in ResolveProxy()
376 v8::HandleScope scope(isolate_); in ResolveProxy()
378 v8::Local<v8::Context> context = in ResolveProxy()
379 v8::Local<v8::Context>::New(isolate_, v8_context_); in ResolveProxy()
380 v8::Context::Scope function_scope(context); in ResolveProxy()
382 v8::Local<v8::Value> function; in ResolveProxy()
388 v8::Handle<v8::Value> argv[] = { in ResolveProxy()
392 v8::TryCatch try_catch(isolate_); in ResolveProxy()
393 v8::Local<v8::Value> ret = v8::Function::Cast(*function)->Call( in ResolveProxy()
421 v8::Locker locked(isolate_); in InitV8()
422 v8::Isolate::Scope isolate_scope(isolate_); in InitV8()
423 v8::HandleScope scope(isolate_); in InitV8()
425 v8_this_.Reset(isolate_, v8::External::New(isolate_, this)); in InitV8()
426 v8::Local<v8::External> v8_this = in InitV8()
427 v8::Local<v8::External>::New(isolate_, v8_this_); in InitV8()
428 v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(isolate_); in InitV8()
431 v8::Local<v8::FunctionTemplate> alert_template = in InitV8()
432 v8::FunctionTemplate::New(isolate_, &AlertCallback, v8_this); in InitV8()
435 v8::Local<v8::FunctionTemplate> my_ip_address_template = in InitV8()
436 v8::FunctionTemplate::New(isolate_, &MyIpAddressCallback, v8_this); in InitV8()
440 v8::Local<v8::FunctionTemplate> dns_resolve_template = in InitV8()
441 v8::FunctionTemplate::New(isolate_, &DnsResolveCallback, v8_this); in InitV8()
447 v8::Local<v8::FunctionTemplate> dns_resolve_ex_template = in InitV8()
448 v8::FunctionTemplate::New(isolate_, &DnsResolveExCallback, v8_this); in InitV8()
452 v8::Local<v8::FunctionTemplate> my_ip_address_ex_template = in InitV8()
453 v8::FunctionTemplate::New(isolate_, &MyIpAddressExCallback, v8_this); in InitV8()
457 v8::Local<v8::FunctionTemplate> sort_ip_address_list_template = in InitV8()
458 v8::FunctionTemplate::New(isolate_, &SortIpAddressListCallback, v8_this); in InitV8()
462 v8::Local<v8::FunctionTemplate> is_in_net_ex_template = in InitV8()
463 v8::FunctionTemplate::New(isolate_, &IsInNetExCallback, v8_this); in InitV8()
468 isolate_, v8::Context::New(isolate_, NULL, global_template)); in InitV8()
470 v8::Local<v8::Context> context = in InitV8()
471 v8::Local<v8::Context>::New(isolate_, v8_context_); in InitV8()
472 v8::Context::Scope ctx(context); in InitV8()
494 v8::Local<v8::Value> function; in InitV8()
502 v8::Locker locked(isolate_); in PurgeMemory()
503 v8::Isolate::Scope isolate_scope(isolate_); in PurgeMemory()
508 bool GetFindProxyForURL(v8::Local<v8::Value>* function) { in GetFindProxyForURL()
509 v8::Local<v8::Context> context = in GetFindProxyForURL()
510 v8::Local<v8::Context>::New(isolate_, v8_context_); in GetFindProxyForURL()
517 void HandleError(v8::Handle<v8::Message> message) { in HandleError()
525 int RunScript(v8::Handle<v8::String> script, const char* script_name) { in RunScript()
526 v8::Local<v8::Context> context = in RunScript()
527 v8::Local<v8::Context>::New(isolate_, v8_context_); in RunScript()
528 v8::TryCatch try_catch(isolate_); in RunScript()
531 v8::ScriptOrigin origin = in RunScript()
532 v8::ScriptOrigin(ASCIILiteralToV8String(isolate_, script_name)); in RunScript()
533 v8::MaybeLocal<v8::Script> code = v8::Script::Compile(context, script, &origin); in RunScript()
549 static void AlertCallback(const v8::FunctionCallbackInfo<v8::Value>& args) { in AlertCallback()
551 static_cast<Context*>(v8::External::Cast(*args.Data())->Value()); in AlertCallback()
569 const v8::FunctionCallbackInfo<v8::Value>& args) { in MyIpAddressCallback()
571 static_cast<Context*>(v8::External::Cast(*args.Data())->Value()); in MyIpAddressCallback()
577 v8::Unlocker unlocker(args.GetIsolate()); in MyIpAddressCallback()
593 const v8::FunctionCallbackInfo<v8::Value>& args) { in MyIpAddressExCallback()
595 static_cast<Context*>(v8::External::Cast(*args.Data())->Value()); in MyIpAddressExCallback()
601 v8::Unlocker unlocker(args.GetIsolate()); in MyIpAddressExCallback()
614 static void DnsResolveCallback(const v8::FunctionCallbackInfo<v8::Value>& args) { in DnsResolveCallback()
616 static_cast<Context*>(v8::External::Cast(*args.Data())->Value()); in DnsResolveCallback()
628 v8::Unlocker unlocker(args.GetIsolate()); in DnsResolveCallback()
641 const v8::FunctionCallbackInfo<v8::Value>& args) { in DnsResolveExCallback()
643 static_cast<Context*>(v8::External::Cast(*args.Data())->Value()); in DnsResolveExCallback()
656 v8::Unlocker unlocker(args.GetIsolate()); in DnsResolveExCallback()
668 const v8::FunctionCallbackInfo<v8::Value>& args) { in SortIpAddressListCallback()
686 static void IsInNetExCallback(const v8::FunctionCallbackInfo<v8::Value>& args) { in IsInNetExCallback()
701 v8::Isolate* isolate_;
702 v8::Persistent<v8::External> v8_this_;
703 v8::Persistent<v8::Context> v8_context_;
720 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); in ProxyResolverV8()
721 v8::V8::InitializePlatform(platform); in ProxyResolverV8()
722 v8::V8::Initialize(); in ProxyResolverV8()
767 v8::V8::SetFlagsFromString(kNoOpt, strlen(kNoOpt)); in SetPacScript()
771 v8::Isolate::CreateParams create_params; in SetPacScript()
774 context_ = new Context(js_bindings_, error_listener_, v8::Isolate::New(create_params)); in SetPacScript()