Lines Matching refs:callbackInfo
101 TimerCallbackInfo* callbackInfo = iter->second;
102 if (callbackInfo->env_ != env) {
106 Helper::CloseHelp::DeletePointer(callbackInfo, false);
115 TimerCallbackInfo* callbackInfo = static_cast<TimerCallbackInfo*>(handle->data);
116 if (callbackInfo == nullptr) {
119 // Save the following parameters to ensure that they can still obtained if callback clears the callbackInfo.
120 bool repeat = callbackInfo->repeat_;
121 uint32_t tId = callbackInfo->tId_;
122 napi_env env = callbackInfo->env_;
124 ContainerScope containerScope(callbackInfo->containerScopeId_);
132 napi_value callback = Helper::NapiHelper::GetReferenceValue(env, callbackInfo->callback_);
135 napi_value* callbackArgv = new napi_value[callbackInfo->argc_];
136 for (size_t idx = 0; idx < callbackInfo->argc_; idx++) {
137 callbackArgv[idx] = Helper::NapiHelper::GetReferenceValue(env, callbackInfo->argv_[idx]);
141 callbackInfo->argc_, callbackArgv, &callbackResult);
153 DeleteTimer(tId, callbackInfo);
157 // callback maybe contain ClearTimer, so we need check to avoid use-after-free and double-free of callbackInfo
166 Helper::CloseHelp::DeletePointer(callbackInfo, false);
200 TimerCallbackInfo* callbackInfo = nullptr;
205 callbackInfo = new TimerCallbackInfo(env, tId, timeout, callbackRef, repeat, callbackArgc, callbackArgv);
207 callbackInfo->containerScopeId_ = ContainerScope::CurrentId();
212 timerTable[tId] = callbackInfo;
221 uv_timer_start(callbackInfo->timeReq_, TimerCallback, timeout >= 0 ? timeout : 1, timeout > 0 ? timeout : 1);
256 TimerCallbackInfo* callbackInfo = iter->second;
257 if (callbackInfo->env_ == env) {
259 Helper::CloseHelp::DeletePointer(callbackInfo, false);
275 void Timer::DeleteTimer(uint32_t tId, TimerCallbackInfo* callbackInfo)
278 // callback maybe contain ClearTimer, so we need check to avoid use-after-free and double-free of callbackInfo
281 Helper::CloseHelp::DeletePointer(callbackInfo, false);