mirror of
https://github.com/openharmony/js_api_module.git
synced 2026-07-19 10:16:08 -04:00
!56 Modify structure member variable initialization operations
Merge pull request !56 from hyq5234/master
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
|
||||
#include "base/compileruntime/js_worker_module/plugin/timer.h"
|
||||
|
||||
#include "base/compileruntime/js_worker_module/helper/napi_helper.h"
|
||||
#include "base/compileruntime/js_worker_module/helper/object_helper.h"
|
||||
#include "utils/log.h"
|
||||
|
||||
namespace CompilerRuntime::WorkerModule::Plugin {
|
||||
@@ -165,8 +163,6 @@ napi_value Timer::SetTimeoutInner(napi_env env, napi_callback_info cbinfo, bool
|
||||
napi_ref callbackRef = Helper::NapiHelper::CreateReference(env, argv[0], 1);
|
||||
TimerCallbackInfo* callbackInfo =
|
||||
new TimerCallbackInfo(env, tId, timeout, callbackRef, repeat, callbackArgc, callbackArgv);
|
||||
uv_loop_t* loop = Helper::NapiHelper::GetLibUV(env);
|
||||
uv_timer_init(loop, &callbackInfo->timeReq_);
|
||||
// 5. push callback info into timerTable
|
||||
timerTable[tId] = callbackInfo;
|
||||
|
||||
|
||||
+7
-1
@@ -18,6 +18,9 @@
|
||||
|
||||
#include <map>
|
||||
#include <uv.h>
|
||||
|
||||
#include "base/compileruntime/js_worker_module/helper/napi_helper.h"
|
||||
#include "base/compileruntime/js_worker_module/helper/object_helper.h"
|
||||
#include "napi/native_api.h"
|
||||
#include "napi/native_node_api.h"
|
||||
|
||||
@@ -36,7 +39,10 @@ struct TimerCallbackInfo {
|
||||
bool repeat, size_t argc, napi_ref* argv)
|
||||
: env_(env), tId_(tId), timeout_(timeout), callback_(callback),
|
||||
repeat_(repeat), argc_(argc), argv_(argv)
|
||||
{}
|
||||
{
|
||||
uv_loop_t* loop = Helper::NapiHelper::GetLibUV(env_);
|
||||
uv_timer_init(loop, &timeReq_);
|
||||
}
|
||||
|
||||
~TimerCallbackInfo();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user