Lines Matching refs:Worker

48 Worker::Worker(Environment* env,
90 // Mark this Worker object as weak until we actually start the thread.
96 bool Worker::is_stopped() const {
103 void Worker::UpdateResourceConstraints(ResourceConstraints* constraints) {
136 explicit WorkerThreadData(Worker* w)
166 isolate->AddNearHeapLimitCallback(Worker::NearHeapLimit, w);
193 Debug(w_, "Worker %llu dispose isolate", w_->thread_id_.id);
232 Worker* const w_;
237 friend class Worker;
240 size_t Worker::NearHeapLimit(void* data, size_t current_heap_limit,
242 Worker* worker = static_cast<Worker*>(data);
260 void Worker::Run() {
376 Debug(this, "Worker %llu thread stops", thread_id_.id);
379 bool Worker::CreateEnvMessagePort(Environment* env) {
399 void Worker::JoinThread() {
436 Worker::~Worker() {
443 Debug(this, "Worker %llu destroyed", thread_id_.id);
446 void Worker::New(const FunctionCallbackInfo<Value>& args) {
588 Worker* worker = new Worker(env,
616 void Worker::StartThread(const FunctionCallbackInfo<Value>& args) {
617 Worker* w;
644 Worker* w = static_cast<Worker*>(arg);
655 [w = std::unique_ptr<Worker>(w)](Environment* env) {
686 void Worker::StopThread(const FunctionCallbackInfo<Value>& args) {
687 Worker* w;
690 Debug(w, "Worker %llu is getting stopped by parent", w->thread_id_.id);
694 void Worker::Ref(const FunctionCallbackInfo<Value>& args) {
695 Worker* w;
703 void Worker::HasRef(const FunctionCallbackInfo<Value>& args) {
704 Worker* w;
709 void Worker::Unref(const FunctionCallbackInfo<Value>& args) {
710 Worker* w;
718 void Worker::GetResourceLimits(const FunctionCallbackInfo<Value>& args) {
719 Worker* w;
724 Local<Float64Array> Worker::GetResourceLimits(Isolate* isolate) const {
731 void Worker::Exit(int code, const char* error_code, const char* error_message) {
733 Debug(this, "Worker %llu called Exit(%d, %s, %s)",
749 bool Worker::IsNotIndicativeOfMemoryLeakAtExit() const {
750 // Worker objects always stay alive as long as the child thread, regardless
765 void Worker::TakeHeapSnapshot(const FunctionCallbackInfo<Value>& args) {
766 Worker* w;
769 Debug(w, "Worker %llu taking heap snapshot", w->thread_id_.id);
823 void Worker::LoopIdleTime(const FunctionCallbackInfo<Value>& args) {
824 Worker* w;
838 void Worker::LoopStartTime(const FunctionCallbackInfo<Value>& args) {
839 Worker* w;
859 // with the internal [kPort] port of the JS Worker class in the parent thread.
879 Local<FunctionTemplate> w = NewFunctionTemplate(isolate, Worker::New);
882 Worker::kInternalFieldCount);
885 SetProtoMethod(isolate, w, "startThread", Worker::StartThread);
886 SetProtoMethod(isolate, w, "stopThread", Worker::StopThread);
887 SetProtoMethod(isolate, w, "hasRef", Worker::HasRef);
888 SetProtoMethod(isolate, w, "ref", Worker::Ref);
889 SetProtoMethod(isolate, w, "unref", Worker::Unref);
890 SetProtoMethod(isolate, w, "getResourceLimits", Worker::GetResourceLimits);
891 SetProtoMethod(isolate, w, "takeHeapSnapshot", Worker::TakeHeapSnapshot);
892 SetProtoMethod(isolate, w, "loopIdleTime", Worker::LoopIdleTime);
893 SetProtoMethod(isolate, w, "loopStartTime", Worker::LoopStartTime);
895 SetConstructorFunction(context, target, "Worker", w);
948 registry->Register(Worker::New);
949 registry->Register(Worker::StartThread);
950 registry->Register(Worker::StopThread);
951 registry->Register(Worker::HasRef);
952 registry->Register(Worker::Ref);
953 registry->Register(Worker::Unref);
954 registry->Register(Worker::GetResourceLimits);
955 registry->Register(Worker::TakeHeapSnapshot);
956 registry->Register(Worker::LoopIdleTime);
957 registry->Register(Worker::LoopStartTime);