Home
last modified time | relevance | path

Searched refs:asyncCallbackInfo (Results 1 – 18 of 18) sorted by relevance

/base/notification/common_event_service/interfaces/kits/napi/common_event/src/
Dcommon_event.cpp361 AsyncCallbackInfoCreate *&asyncCallbackInfo, const napi_ref &callback, napi_value &promise) in PaddingAsyncCallbackInfoCreateSubscriber() argument
366 asyncCallbackInfo->info.callback = callback; in PaddingAsyncCallbackInfoCreateSubscriber()
367 asyncCallbackInfo->info.isCallback = true; in PaddingAsyncCallbackInfoCreateSubscriber()
371 asyncCallbackInfo->info.deferred = deferred; in PaddingAsyncCallbackInfoCreateSubscriber()
372 asyncCallbackInfo->info.isCallback = false; in PaddingAsyncCallbackInfoCreateSubscriber()
394 AsyncCallbackInfoCreate *asyncCallbackInfo = in CreateSubscriber()
396 if (asyncCallbackInfo == nullptr) { in CreateSubscriber()
402 PaddingAsyncCallbackInfoCreateSubscriber(env, argc, asyncCallbackInfo, callback, promise); in CreateSubscriber()
404 napi_create_reference(env, argv[0], 1, &asyncCallbackInfo->subscribeInfo); in CreateSubscriber()
418 … AsyncCallbackInfoCreate *asyncCallbackInfo = static_cast<AsyncCallbackInfoCreate *>(data); in CreateSubscriber() local
[all …]
/base/notification/common_event_service/interfaces/kits/napi/napi_common_event/src/
Dnapi_common_event.cpp386 AsyncCallbackInfoCreate *&asyncCallbackInfo, const napi_ref &callback, napi_value &promise) in PaddingAsyncCallbackInfoCreateSubscriber() argument
391 asyncCallbackInfo->info.callback = callback; in PaddingAsyncCallbackInfoCreateSubscriber()
392 asyncCallbackInfo->info.isCallback = true; in PaddingAsyncCallbackInfoCreateSubscriber()
396 asyncCallbackInfo->info.deferred = deferred; in PaddingAsyncCallbackInfoCreateSubscriber()
397 asyncCallbackInfo->info.isCallback = false; in PaddingAsyncCallbackInfoCreateSubscriber()
419 AsyncCallbackInfoCreate *asyncCallbackInfo = in CreateSubscriber()
421 if (asyncCallbackInfo == nullptr) { in CreateSubscriber()
427 PaddingAsyncCallbackInfoCreateSubscriber(env, argc, asyncCallbackInfo, callback, promise); in CreateSubscriber()
429 napi_create_reference(env, argv[0], 1, &asyncCallbackInfo->subscribeInfo); in CreateSubscriber()
441 … AsyncCallbackInfoCreate *asyncCallbackInfo = static_cast<AsyncCallbackInfoCreate *>(data); in CreateSubscriber() local
[all …]
/base/sensors/miscdevice/interfaces/plugin/vibrator/src/
Dvibrator_napi_utils.cpp140 void EmitSystemCallback(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo) in EmitSystemCallback() argument
142 CHKPV(asyncCallbackInfo); in EmitSystemCallback()
143 if (asyncCallbackInfo->error.code == SUCCESS) { in EmitSystemCallback()
144 CHKPV(asyncCallbackInfo->callback[0]); in EmitSystemCallback()
146 …NAPI_CALL_RETURN_VOID(env, napi_get_reference_value(env, asyncCallbackInfo->callback[0], &callback… in EmitSystemCallback()
153 CHKPV(asyncCallbackInfo->callback[1]); in EmitSystemCallback()
155 …NAPI_CALL_RETURN_VOID(env, napi_get_reference_value(env, asyncCallbackInfo->callback[1], &callback… in EmitSystemCallback()
157 NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, asyncCallbackInfo->error.message.data(), in EmitSystemCallback()
159 NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, asyncCallbackInfo->error.code, &result[1])); in EmitSystemCallback()
164 void EmitAsyncCallbackWork(sptr<AsyncCallbackInfo> asyncCallbackInfo) in EmitAsyncCallbackWork() argument
[all …]
Dvibrator_js.cpp63 sptr<AsyncCallbackInfo> asyncCallbackInfo = new (std::nothrow) AsyncCallbackInfo(env); in VibrateTime() local
64 CHKPP(asyncCallbackInfo); in VibrateTime()
66 asyncCallbackInfo->error.code = StartVibratorOnce(duration); in VibrateTime()
69 NAPI_CALL(env, napi_create_reference(env, args[1], 1, &asyncCallbackInfo->callback[0])); in VibrateTime()
70 EmitAsyncCallbackWork(asyncCallbackInfo); in VibrateTime()
77 asyncCallbackInfo->deferred = deferred; in VibrateTime()
78 EmitPromiseWork(asyncCallbackInfo); in VibrateTime()
87 sptr<AsyncCallbackInfo> asyncCallbackInfo = new (std::nothrow) AsyncCallbackInfo(env); in VibrateEffectId() local
88 CHKPP(asyncCallbackInfo); in VibrateEffectId()
89 asyncCallbackInfo->error.code = StartVibrator(effectId.c_str()); in VibrateEffectId()
[all …]
/base/sensors/sensor/interfaces/plugin/src/
Dsensor_napi_utils.cpp150 sptr<AsyncCallbackInfo> &asyncCallbackInfo) in CreateFailMessage() argument
152 CHKPF(asyncCallbackInfo); in CreateFailMessage()
153 asyncCallbackInfo->type = type; in CreateFailMessage()
154 asyncCallbackInfo->error.code = code; in CreateFailMessage()
155 asyncCallbackInfo->error.message = message; in CreateFailMessage()
204 bool getJsonObject(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_value &resu… in getJsonObject() argument
206 CHKPF(asyncCallbackInfo); in getJsonObject()
209 …CHKNRF(env, napi_create_double(env, asyncCallbackInfo->data.geomagneticData.x, &value), "napi_crea… in getJsonObject()
212 …CHKNRF(env, napi_create_double(env, asyncCallbackInfo->data.geomagneticData.y, &value), "napi_crea… in getJsonObject()
215 …CHKNRF(env, napi_create_double(env, asyncCallbackInfo->data.geomagneticData.z, &value), "napi_crea… in getJsonObject()
[all …]
Dsensor_js.cpp225 …sptr<AsyncCallbackInfo> asyncCallbackInfo = new (std::nothrow) AsyncCallbackInfo(env, ONCE_CALLBAC… in UpdateOnceCallback() local
226 CHKPV(asyncCallbackInfo); in UpdateOnceCallback()
227 napi_status status = napi_create_reference(env, callback, 1, &asyncCallbackInfo->callback[0]); in UpdateOnceCallback()
233 callbackInfos.push_back(asyncCallbackInfo); in UpdateOnceCallback()
297 …sptr<AsyncCallbackInfo> asyncCallbackInfo = new (std::nothrow) AsyncCallbackInfo(env, ON_CALLBACK); in UpdateCallbackInfos() local
298 CHKPV(asyncCallbackInfo); in UpdateCallbackInfos()
299 napi_status status = napi_create_reference(env, callback, 1, &asyncCallbackInfo->callback[0]); in UpdateCallbackInfos()
305 callbackInfos.push_back(asyncCallbackInfo); in UpdateCallbackInfos()
494 sptr<AsyncCallbackInfo> asyncCallbackInfo = in GetGeomagneticField() local
496 CHKPP(asyncCallbackInfo); in GetGeomagneticField()
[all …]
/base/customization/enterprise_device_management/interfaces/kits/common/src/
Dnapi_edm_common.cpp126 AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data); in NativeVoidCallbackComplete() local
128 if (asyncCallbackInfo->callback == nullptr) { in NativeVoidCallbackComplete()
130 if (asyncCallbackInfo->ret == ERR_OK) { in NativeVoidCallbackComplete()
132 napi_resolve_deferred(env, asyncCallbackInfo->deferred, error); in NativeVoidCallbackComplete()
134 … napi_reject_deferred(env, asyncCallbackInfo->deferred, CreateError(env, asyncCallbackInfo->ret)); in NativeVoidCallbackComplete()
137 if (asyncCallbackInfo->ret == ERR_OK) { in NativeVoidCallbackComplete()
140 error = CreateError(env, asyncCallbackInfo->ret); in NativeVoidCallbackComplete()
144 napi_get_reference_value(env, asyncCallbackInfo->callback, &callback); in NativeVoidCallbackComplete()
146 napi_delete_reference(env, asyncCallbackInfo->callback); in NativeVoidCallbackComplete()
148 napi_delete_async_work(env, asyncCallbackInfo->asyncWork); in NativeVoidCallbackComplete()
[all …]
/base/customization/enterprise_device_management/interfaces/kits/admin_manager/src/
Dadmin_manager_addon.cpp39 auto asyncCallbackInfo = new (std::nothrow) AsyncEnableAdminCallbackInfo(); in EnableAdmin() local
40 if (asyncCallbackInfo == nullptr) { in EnableAdmin()
43 std::unique_ptr<AsyncEnableAdminCallbackInfo> callbackPtr {asyncCallbackInfo}; in EnableAdmin()
47 …ASSERT_AND_THROW_PARAM_ERROR(env, ParseElementName(env, asyncCallbackInfo->elementName, argv[ARR_I… in EnableAdmin()
49 …ASSERT_AND_THROW_PARAM_ERROR(env, ParseEnterpriseInfo(env, asyncCallbackInfo->entInfo, argv[ARR_IN… in EnableAdmin()
51 …ASSERT_AND_THROW_PARAM_ERROR(env, ParseInt(env, asyncCallbackInfo->adminType, argv[ARR_INDEX_TWO]), in EnableAdmin()
56 asyncCallbackInfo->elementName.GetBundleName().c_str(), in EnableAdmin()
57 asyncCallbackInfo->elementName.GetAbilityName().c_str(), in EnableAdmin()
58 asyncCallbackInfo->adminType); in EnableAdmin()
60 … ASSERT_AND_THROW_PARAM_ERROR(env, ParseInt(env, asyncCallbackInfo->userId, argv[ARR_INDEX_THREE]), in EnableAdmin()
[all …]
/base/sensors/medical_sensor/interfaces/plugin/src/
Dmedical_napi_utils.cpp85 void EmitAsyncCallbackWork(AsyncCallbackInfo *asyncCallbackInfo) in EmitAsyncCallbackWork() argument
88 if (asyncCallbackInfo == nullptr) { in EmitAsyncCallbackWork()
93 …if (napi_create_string_utf8(asyncCallbackInfo->env, "AsyncCallback", NAPI_AUTO_LENGTH, &resourceNa… in EmitAsyncCallbackWork()
98 asyncCallbackInfo->env, nullptr, resourceName, in EmitAsyncCallbackWork()
102 AsyncCallbackInfo *asyncCallbackInfo = reinterpret_cast<AsyncCallbackInfo *>(data); in EmitAsyncCallbackWork() local
104 napi_get_reference_value(env, asyncCallbackInfo->callback[0], &callback); in EmitAsyncCallbackWork()
109 napi_delete_reference(env, asyncCallbackInfo->callback[0]); in EmitAsyncCallbackWork()
110 napi_delete_async_work(env, asyncCallbackInfo->asyncWork); in EmitAsyncCallbackWork()
111 delete asyncCallbackInfo; in EmitAsyncCallbackWork()
112 asyncCallbackInfo = nullptr; in EmitAsyncCallbackWork()
[all …]
Dmedical_js.cpp139 AsyncCallbackInfo *asyncCallbackInfo = new AsyncCallbackInfo { in On() local
144 napi_create_reference(env, args[1], 1, &asyncCallbackInfo->callback[0]); in On()
145 g_onCallbackInfos[sensorTypeId] = asyncCallbackInfo; in On()
149 EmitAsyncCallbackWork(asyncCallbackInfo); in On()
173 AsyncCallbackInfo *asyncCallbackInfo = new AsyncCallbackInfo { in Off() local
187 napi_create_reference(env, args[1], 1, &asyncCallbackInfo->callback[0]); in Off()
201 EmitAsyncCallbackWork(asyncCallbackInfo); in Off()
/base/sensors/sensor/interfaces/plugin/include/
Dsensor_napi_utils.h28 using ConvertDataFunc = bool(*)(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo,
43 void EmitAsyncCallbackWork(sptr<AsyncCallbackInfo> asyncCallbackInfo);
44 void EmitUvEventLoop(sptr<AsyncCallbackInfo> asyncCallbackInfo);
45 void EmitPromiseWork(sptr<AsyncCallbackInfo> asyncCallbackInfo);
46 bool ConvertToFailData(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_value r…
47 bool ConvertToGeomagneticData(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_…
48 bool ConvertToNumber(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_value res…
49 bool ConvertToArray(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_value resu…
50 bool ConvertToRotationMatrix(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_v…
51 bool ConvertToSensorData(const napi_env &env, sptr<AsyncCallbackInfo> asyncCallbackInfo, napi_value…
[all …]
/base/customization/enterprise_device_management/interfaces/kits/datetime_manager/src/
Ddatetime_manager_addon.cpp44 auto asyncCallbackInfo = new (std::nothrow) AsyncSetDateTimeCallbackInfo(); in SetDateTime() local
45 if (asyncCallbackInfo == nullptr) { in SetDateTime()
48 std::unique_ptr<AsyncSetDateTimeCallbackInfo> callbackPtr {asyncCallbackInfo}; in SetDateTime()
49 bool ret = ParseElementName(env, asyncCallbackInfo->elementName, argv[ARR_INDEX_ZERO]); in SetDateTime()
53 asyncCallbackInfo->elementName.GetBundleName().c_str(), in SetDateTime()
54 asyncCallbackInfo->elementName.GetAbilityName().c_str()); in SetDateTime()
55 ret = ParseLong(env, asyncCallbackInfo->time, argv[ARR_INDEX_ONE]); in SetDateTime()
59 … napi_create_reference(env, argv[ARR_INDEX_TWO], NAPI_RETURN_ONE, &asyncCallbackInfo->callback); in SetDateTime()
62 napi_value asyncWorkReturn = HandleAsyncWork(env, asyncCallbackInfo, "SetDateTime", in SetDateTime()
75 …AsyncSetDateTimeCallbackInfo *asyncCallbackInfo = static_cast<AsyncSetDateTimeCallbackInfo *>(data… in NativeSetDateTime() local
[all …]
/base/powermgr/power_manager/frameworks/napi/power/
Dpower.cpp83 PowerAsyncCallbackInfo* asyncCallbackInfo = (PowerAsyncCallbackInfo*)data; in IsScreenOnCallBack() local
84 asyncCallbackInfo->screenOn = g_powerMgrClient.IsScreenOn(); in IsScreenOnCallBack()
85 … POWER_HILOGD(COMP_FWK, "Screen is %{public}s ", asyncCallbackInfo->screenOn ? "ON" : "OFF"); in IsScreenOnCallBack()
88 PowerAsyncCallbackInfo* asyncCallbackInfo = (PowerAsyncCallbackInfo*)data; in IsScreenOnCallBack() local
90 napi_get_boolean(env, asyncCallbackInfo->screenOn, &result[1]); in IsScreenOnCallBack()
91 if (asyncCallbackInfo->deferred) { in IsScreenOnCallBack()
92 napi_resolve_deferred(env, asyncCallbackInfo->deferred, result[1]); in IsScreenOnCallBack()
96 napi_get_reference_value(env, asyncCallbackInfo->callbackRef, &callback); in IsScreenOnCallBack()
99 napi_delete_reference(env, asyncCallbackInfo->callbackRef); in IsScreenOnCallBack()
101 napi_delete_async_work(env, asyncCallbackInfo->asyncWork); in IsScreenOnCallBack()
[all …]
/base/customization/config_policy/interfaces/kits/js/src/
Dconfig_policy_napi.cpp178 ConfigAsyncContext *asyncCallbackInfo = static_cast<ConfigAsyncContext *>(data); in NativeGetOneCfgFile() local
180 GetOneCfgFile(asyncCallbackInfo->relPath_.c_str(), outBuf, MAX_PATH_LEN); in NativeGetOneCfgFile()
181 asyncCallbackInfo->pathValue_ = std::string(outBuf); in NativeGetOneCfgFile()
183asyncCallbackInfo->createValueFunc_ = [](napi_env env, ConfigAsyncContext &context) -> napi_value { in NativeGetOneCfgFile()
197 ConfigAsyncContext *asyncCallbackInfo = static_cast<ConfigAsyncContext *>(data); in NativeGetCfgFiles() local
198 CfgFiles *cfgFiles = GetCfgFiles(asyncCallbackInfo->relPath_.c_str()); in NativeGetCfgFiles()
201 asyncCallbackInfo->paths_.push_back(cfgFiles->paths[i]); in NativeGetCfgFiles()
205 CreateArraysValueFunc(*asyncCallbackInfo); in NativeGetCfgFiles()
216 ConfigAsyncContext *asyncCallbackInfo = static_cast<ConfigAsyncContext *>(data); in NativeGetCfgDirList() local
220 asyncCallbackInfo->paths_.push_back(cfgDir->paths[i]); in NativeGetCfgDirList()
[all …]
/base/notification/distributed_notification_service/frameworks/js/napi/src/reminder/
Dpublish.cpp67 …lue GetCallback(const napi_env &env, const napi_value &value, AsyncCallbackInfo &asyncCallbackInfo) in GetCallback() argument
75 napi_create_reference(env, value, 1, &asyncCallbackInfo.callback); in GetCallback()
86 AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) in ParseParameters() argument
101 if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { in ParseParameters()
123 AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) in ParseSlotParameters() argument
138 if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { in ParseSlotParameters()
171 AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) in ParseCanCelParameter() argument
187 if (GetCallback(env, argv[1], asyncCallbackInfo) == nullptr) { in ParseCanCelParameter()
217 AsyncCallbackInfo &asyncCallbackInfo, bool isThrow) in ParseCanCelAllParameter() argument
226 if (GetCallback(env, argv[0], asyncCallbackInfo) == nullptr) { in ParseCanCelAllParameter()
[all …]
/base/sensors/miscdevice/interfaces/plugin/vibrator/include/
Dvibrator_napi_utils.h63 void EmitPromiseWork(sptr<AsyncCallbackInfo> asyncCallbackInfo);
/base/notification/common_event_service/interfaces/kits/napi/common_event/include/
Dcommon_event.h40 std::vector<AsyncCallbackInfoSubscribe *> asyncCallbackInfo; member
/base/notification/common_event_service/interfaces/kits/napi/napi_common_event/include/
Dnapi_common_event.h40 std::vector<AsyncCallbackInfoSubscribe *> asyncCallbackInfo; member