/base/telephony/sms_mms/frameworks/js/napi/src/ |
D | delivery_callback.cpp | 26 : hasCallback_(hasCallback), env_(env), thisVarRef_(thisVarRef), callbackRef_(callbackRef) in DeliveryCallback() 31 env_ = nullptr; in ~DeliveryCallback() 48 napi_env env_ = pContext->env; in CompleteSmsDeliveryWork() local 53 napi_open_handle_scope(env_, &scope); in CompleteSmsDeliveryWork() 56 napi_close_handle_scope(env_, scope); in CompleteSmsDeliveryWork() 60 napi_get_reference_value(env_, callbackRef_, &callbackFunc); in CompleteSmsDeliveryWork() 63 callbackValues[0] = NapiUtil::CreateUndefined(env_); in CompleteSmsDeliveryWork() 64 napi_create_object(env_, &callbackValues[1]); in CompleteSmsDeliveryWork() 66 napi_create_array(env_, &arrayValue); in CompleteSmsDeliveryWork() 70 napi_create_int32(env_, intValue, &element); in CompleteSmsDeliveryWork() [all …]
|
D | send_callback.cpp | 44 : hasCallback_(hasCallback), env_(env), thisVarRef_(thisVarRef), callbackRef_(callbackRef) in SendCallback() 49 env_ = nullptr; in ~SendCallback() 66 napi_env env_ = pContext->env; in CompleteSmsSendWork() local 71 napi_open_handle_scope(env_, &scope); in CompleteSmsSendWork() 74 napi_close_handle_scope(env_, scope); in CompleteSmsSendWork() 78 napi_get_reference_value(env_, callbackRef_, &callbackFunc); in CompleteSmsSendWork() 80 callbackValues[0] = NapiUtil::CreateUndefined(env_); in CompleteSmsSendWork() 81 napi_create_object(env_, &callbackValues[1]); in CompleteSmsSendWork() 83 napi_create_int32(env_, wrapResult, &sendResultValue); in CompleteSmsSendWork() 84 napi_set_named_property(env_, callbackValues[1], "result", sendResultValue); in CompleteSmsSendWork() [all …]
|
/base/msdp/device_status/frameworks/js/napi/src/ |
D | devicestatus_event.cpp | 37 env_ = env; in DeviceStatusEvent() 54 napi_open_handle_scope(env_, &scope); in On() 64 status = napi_create_reference(env_, handler, 1, &onHandlerRef); in On() 67 napi_close_handle_scope(env_, scope); in On() 80 status = napi_create_reference(env_, handler, 1, &onHandlerRef); in On() 83 napi_close_handle_scope(env_, scope); in On() 91 napi_close_handle_scope(env_, scope); in On() 107 napi_status status = napi_get_reference_value(env_, listener->onHandlerRef, &result); in Off() 112 status = napi_strict_equals(env_, result, handler, &equal); in Off() 119 status = napi_delete_reference(env_, listener->onHandlerRef); in Off() [all …]
|
/base/powermgr/battery_statistics/frameworks/napi/src/ |
D | battery_stats.cpp | 29 BatteryStats::BatteryStats(napi_env& env) : env_(env) {} in BatteryStats() 34 asyncInfo->CreateCallback(env_, value); in StatsAsyncCallBack() 36 …NAPI_CALL_RETURN_VOID(env_, napi_create_string_utf8(env_, "StatsAsyncCallBack", NAPI_AUTO_LENGTH, … in StatsAsyncCallBack() 38 env_, nullptr, resource, in StatsAsyncCallBack() 55 env_, napi_queue_async_work_with_qos(env_, asyncInfo->GetAsyncWork(), napi_qos_utility)); in StatsAsyncCallBack() 63 asyncInfo->CreatePromise(env_, promise); in StatsPromise() 67 …NAPI_CALL_BASE(env_, napi_create_string_utf8(env_, "StatsPromise", NAPI_AUTO_LENGTH, &resourceName… in StatsPromise() 69 env_, nullptr, resourceName, in StatsPromise() 89 …NAPI_CALL_BASE(env_, napi_queue_async_work_with_qos(env_, asyncInfo->GetAsyncWork(), napi_qos_util… in StatsPromise() 141 NapiUtils::GetCallbackInfo(env_, info, argc, argv); in GetAppOrPartStats() [all …]
|
/base/request/request/frameworks/js/napi/src/ |
D | request_notify.cpp | 32 env_ = env; in RequestNotify() 41 if (valid_ && env_ != nullptr && ref_ != nullptr) { in ~RequestNotify() 42 UvQueue::DeleteRef(env_, ref_); in ~RequestNotify() 57 napi_get_uv_event_loop(env_, &loop); in CallBack() 101 napi_open_handle_scope(env_, &scope); in ExecCallBack() 103 napi_get_reference_value(env_, ref_, &callbackFunc); in ExecCallBack() 108 napi_call_function(env_, nullptr, callbackFunc, paramNumber, callbackValues, &callbackResult); in ExecCallBack() 109 napi_close_handle_scope(env_, scope); in ExecCallBack() 121 value[i] = NapiUtils::Convert2JSValue(env_, notify_.data[i]); in ConvertCallBackData() 124 value[0] = NapiUtils::Convert2JSHeaders(env_, notify_.header); in ConvertCallBackData() [all …]
|
/base/hiviewdfx/hilog/interfaces/js/kits/napi/src/common/napi/ |
D | n_val.cpp | 25 NVal::NVal(napi_env nEnv, napi_value nVal = nullptr) : env_(nEnv), val_(nVal) {} in NVal() 29 return env_ && val_; in operator bool() 39 napi_typeof(env_, val_, &valueType); in TypeIs() 50 napi_status status = napi_is_array(env_, val_, &res); in IsArray() 57 napi_status status = napi_get_value_string_utf8(env_, val_, nullptr, -1, &strLen); in ToUTF8String() 64 status = napi_get_value_string_utf8(env_, val_, str.get(), bufLen, &strLen); in ToUTF8String() 72 napi_status status = napi_get_value_string_utf16(env_, val_, nullptr, -1, &strLen); in ToUTF16String() 78 status = napi_get_value_string_utf16(env_, val_, str.get(), strLen, nullptr); in ToUTF16String() 95 napi_status status = napi_get_value_external(env_, val_, &res); in ToPointer() 102 napi_status status = napi_is_typedarray(env_, val_, &res); in IsTypeArray() [all …]
|
/base/inputmethod/imf/frameworks/js/napi/common/ |
D | js_callback_object.cpp | 24 : env_(env), threadId_(threadId) in JSCallbackObject() 33 napi_delete_reference(env_, callback_); in ~JSCallbackObject() 34 env_ = nullptr; in ~JSCallbackObject() 41 napi_get_uv_event_loop(env_, &loop); in ~JSCallbackObject() 46 napi_delete_reference(jsObject->env_, jsObject->callback_); in ~JSCallbackObject() 53 env_ = nullptr; in ~JSCallbackObject()
|
D | js_callback_handler.cpp | 28 …if (argContainer.argvProvider != nullptr && !argContainer.argvProvider(object->env_, argv, MAX_ARG… in Execute() 33 napi_get_reference_value(object->env_, object->callback_, &callback); in Execute() 35 napi_get_global(object->env_, &global); in Execute() 37 …auto status = napi_call_function(object->env_, global, callback, argContainer.argc, argv, &output); in Execute()
|
/base/update/updateservice/frameworks/js/napi/base/src/ |
D | session_manager.cpp | 30 SessionManager::SessionManager(napi_env env, napi_ref thisReference) : env_(env), thisReference_(th… in SessionManager() 62 napi_delete_reference(env_, thisReference_); in Clear() 102 napi_status status = napi_open_handle_scope(env_, &scope); in ProcessUnsubscribe() 122 listener->RemoveHandlerRef(env_); in ProcessUnsubscribe() 124 } else if (listener->CheckEqual(env_, arg, eventType)) { in ProcessUnsubscribe() 125 listener->RemoveHandlerRef(env_); in ProcessUnsubscribe() 130 napi_close_handle_scope(env_, scope); in ProcessUnsubscribe() 155 if (listener->IsSameListener(env_, eventClassifyInfo, handle)) { in Unsubscribe() 181 …if ((eventType.compare(listener->GetEventType()) == 0) && listener->CheckEqual(env_, arg, eventTyp… in FindSessionByHandle() 212 napi_status status = napi_open_handle_scope(env_, &scope); in PublishToJS() [all …]
|
/base/location/frameworks/native/source/ |
D | location_switch_callback_host.cpp | 25 env_ = nullptr; in LocationSwitchCallbackHost() 68 NAPI_CALL(env_, napi_get_boolean(env_, switchState, &result)); in PackResult() 76 NAPI_CALL_BASE(env_, napi_get_uv_event_loop(env_, &loop), false); in Send() 86 SwitchAsyncContext *context = new (std::nothrow) SwitchAsyncContext(env_); in Send() 91 context->env = env_; in Send() 155 if (handlerCb_ == nullptr || env_ == nullptr) { in DeleteHandler() 159 auto context = new (std::nothrow) AsyncContext(env_); in DeleteHandler() 164 context->env = env_; in DeleteHandler()
|
D | nmea_message_callback_host.cpp | 28 env_ = nullptr; in NmeaMessageCallbackHost() 73 NAPI_CALL(env_, napi_create_string_utf8(env_, msg.c_str(), NAPI_AUTO_LENGTH, &result)); in PackResult() 82 NAPI_CALL_BASE(env_, napi_get_uv_event_loop(env_, &loop), false); in Send() 92 NmeaAsyncContext *context = new (std::nothrow) NmeaAsyncContext(env_); in Send() 97 context->env = env_; in Send() 164 if (handlerCb_ == nullptr || env_ == nullptr) { in DeleteHandler() 168 auto context = new (std::nothrow) AsyncContext(env_); in DeleteHandler() 173 context->env = env_; in DeleteHandler()
|
D | country_code_callback_host.cpp | 28 env_ = nullptr; in CountryCodeCallbackHost() 63 if (env_ == nullptr) { in Send() 71 NAPI_CALL_BASE(env_, napi_get_uv_event_loop(env_, &loop), false); in Send() 81 auto context = new (std::nothrow) CountryCodeContext(env_); in Send() 86 context->env = env_; in Send() 156 env_ = env; in SetEnv() 168 if (handlerCb_ == nullptr || env_ == nullptr) { in DeleteHandler() 172 auto context = new (std::nothrow) AsyncContext(env_); in DeleteHandler() 177 context->env = env_; in DeleteHandler()
|
D | gnss_status_callback_host.cpp | 29 env_ = nullptr; in GnssStatusCallbackHost() 75 NAPI_CALL_BASE(env_, napi_get_uv_event_loop(env_, &loop), false); in Send() 85 GnssStatusAsyncContext *context = new (std::nothrow) GnssStatusAsyncContext(env_); in Send() 90 context->env = env_; in Send() 156 if (handlerCb_ == nullptr || env_ == nullptr) { in DeleteHandler() 160 auto context = new (std::nothrow) AsyncContext(env_); in DeleteHandler() 165 context->env = env_; in DeleteHandler()
|
D | cached_locations_callback_host.cpp | 28 env_ = nullptr; in CachedLocationsCallbackHost() 80 NAPI_CALL_BASE(env_, napi_get_uv_event_loop(env_, &loop), false); in Send() 90 CachedLocationAsyncContext *context = new (std::nothrow) CachedLocationAsyncContext(env_); in Send() 95 context->env = env_; in Send() 159 if (handlerCb_ == nullptr || env_ == nullptr) { in DeleteHandler() 163 auto context = new (std::nothrow) AsyncContext(env_); in DeleteHandler() 168 context->env = env_; in DeleteHandler()
|
/base/web/webview/interfaces/kits/napi/webfunction/ |
D | webview_web_inited_callback.cpp | 26 napi_get_uv_event_loop(param_->env_, &loop); in RunInitedCallback() 50 napi_open_handle_scope(data->env_, &scope); in RunInitedCallback() 56 napi_get_reference_value(data->env_, data->webInitedCallback_, &jsWebInitedCallback); in RunInitedCallback() 57 napi_call_function(data->env_, nullptr, jsWebInitedCallback, 0, {}, &webInitedResult); in RunInitedCallback() 59 napi_close_handle_scope(data->env_, scope); in RunInitedCallback()
|
/base/powermgr/display_manager/frameworks/napi/ |
D | brightness.cpp | 55 Brightness::Brightness(napi_env env, std::shared_ptr<RunningLock> runningLock) : env_(env), running… in Brightness() 82 result_.ThrowError(env_, DisplayErrors::ERR_PARAM_INVALID); in SetValue() 87 if (napi_ok != napi_get_value_int32(env_, napiBrightness, &value)) { in SetValue() 92 result_.ThrowError(env_, DisplayErrors::ERR_PARAM_INVALID); in SetValue() 99 result_.ThrowError(env_, error); in SetValue() 112 napi_get_reference_value(env_, napiValRef_, &napiVal); in SystemSetValue() 113 napi_get_value_int32(env_, napiVal, &brightness); in SystemSetValue() 135 napi_get_reference_value(env_, napiValRef_, &napiMode); in SetMode() 136 napi_get_value_int32(env_, napiMode, &mode); in SetMode() 152 napi_get_reference_value(env_, napiValRef_, &napiKeep); in SetKeepScreenOn() [all …]
|
/base/useriam/user_auth_framework/frameworks/js/napi/user_auth/src/ |
D | user_auth_callback_v9.cpp | 131 UserAuthCallbackV9::UserAuthCallbackV9(napi_env env) : env_(env) in UserAuthCallbackV9() 133 if (env_ == nullptr) { in UserAuthCallbackV9() 187 napi_status ret = napi_create_object(env_, &eventInfo); in DoResultCallback() 192 ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "result", result); in DoResultCallback() 197 ret = UserAuthNapiHelper::SetUint8ArrayProperty(env_, eventInfo, "token", token); in DoResultCallback() 204 …ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "remainAttempts", remainTimes.value()); in DoResultCallback() 212 …ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "lockoutDuration", freezingTime.value(… in DoResultCallback() 219 return UserAuthNapiHelper::CallVoidNapiFunc(env_, resultCallback->Get(), ARGS_ONE, &eventInfo); in DoResultCallback() 230 napi_status ret = napi_create_object(env_, &eventInfo); in DoAcquireCallback() 235 ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "module", module); in DoAcquireCallback() [all …]
|
D | user_auth_callback_v8.cpp | 133 : env_(env), resultCallback_(resultCallback), acquireCallback_(acquireCallback) in UserAuthCallbackV8() 135 if (env_ == nullptr) { in UserAuthCallbackV8() 152 napi_status ret = napi_create_int32(env_, result, ¶ms[PARAM0]); in DoResultCallback() 157 ret = napi_create_object(env_, ¶ms[PARAM1]); in DoResultCallback() 164 …ret = UserAuthNapiHelper::SetInt32Property(env_, params[PARAM1], "remainTimes", remainTimes.value(… in DoResultCallback() 172 …ret = UserAuthNapiHelper::SetInt32Property(env_, params[PARAM1], "freezingTime", freezingTime.valu… in DoResultCallback() 179 ret = UserAuthNapiHelper::SetUint8ArrayProperty(env_, params[PARAM1], "token", token); in DoResultCallback() 184 return UserAuthNapiHelper::CallVoidNapiFunc(env_, resultCallback_->Get(), ARGS_TWO, params); in DoResultCallback() 194 napi_status ret = napi_create_int32(env_, module, ¶ms[PARAM0]); in DoAcquireCallback() 199 ret = napi_create_uint32(env_, acquireInfo, ¶ms[PARAM1]); in DoAcquireCallback() [all …]
|
D | user_auth_callback_v10.cpp | 75 UserAuthCallbackV10::UserAuthCallbackV10(napi_env env) : env_(env) in UserAuthCallbackV10() 77 if (env_ == nullptr) { in UserAuthCallbackV10() 119 napi_status ret = napi_create_object(env_, &eventInfo); in DoResultCallback() 124 ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "result", result); in DoResultCallback() 131 ret = UserAuthNapiHelper::SetUint8ArrayProperty(env_, eventInfo, "token", token); in DoResultCallback() 141 ret = UserAuthNapiHelper::SetInt32Property(env_, eventInfo, "authType", authType); in DoResultCallback() 148 return UserAuthNapiHelper::CallVoidNapiFunc(env_, resultCallback->Get(), ARGS_ONE, &eventInfo); in DoResultCallback() 160 napi_status napiStatus = napi_get_uv_event_loop(env_, &loop); in OnResult() 178 resultHolder->env = env_; in OnResult()
|
D | user_auth_callback_v6.cpp | 108 : env_(env), callback_(callback), promise_(promise) in UserAuthCallbackV6() 110 if (env_ == nullptr) { in UserAuthCallbackV6() 126 napi_status ret = napi_create_int32(env_, result, &resultVal); in DoPromise() 132 ret = napi_resolve_deferred(env_, promise_, resultVal); in DoPromise() 137 ret = napi_reject_deferred(env_, promise_, resultVal); in DoPromise() 152 napi_status ret = napi_create_int32(env_, result, &resultVal); in DoCallback() 157 return UserAuthNapiHelper::CallVoidNapiFunc(env_, callback_->Get(), ARGS_ONE, &resultVal); in DoCallback() 170 napi_status napiStatus = napi_get_uv_event_loop(env_, &loop); in OnResult() 195 resultHolder->env = env_; in OnResult()
|
/base/web/webview/interfaces/kits/napi/webviewcontroller/ |
D | webview_hasimage_callback.cpp | 31 napi_get_uv_event_loop(env_, &loop); in OnReceiveValue() 45 param->env_ = env_; in OnReceiveValue() 78 napi_open_handle_scope(param->env_, &scope); in UvAfterWorkCb() 84 UvAfterWorkCbAsync(param->env_, param->callbackRef_, param->result_); in UvAfterWorkCb() 86 UvAfterWorkCbPromise(param->env_, param->deferred_, param->result_); in UvAfterWorkCb() 89 napi_close_handle_scope(param->env_, scope); in UvAfterWorkCb()
|
/base/powermgr/thermal_manager/frameworks/napi/ |
D | thermal_manager_napi.cpp | 48 env_ = env; in UpdateCallback() 55 napi_delete_reference(env_, callbackRef_); in ReleaseCallback() 58 env_ = nullptr; in ReleaseCallback() 65 THERMAL_RETURN_IF_WITH_RET(env_ == nullptr, false); in GetThermalLevel() 67 napi_get_uv_event_loop(env_, &loop); in GetThermalLevel() 96 …THERMAL_RETURN_IF_WITH_LOG(callbackRef_ == nullptr || env_ == nullptr, "js callback ref or env is … in OnThermalLevel() 99 napi_open_handle_scope(env_, &scope); in OnThermalLevel() 106 if (napi_ok != napi_create_int32(env_, static_cast<int32_t>(level_), &levelValue)) { in OnThermalLevel() 108 napi_close_handle_scope(env_, scope); in OnThermalLevel() 113 napi_status status = napi_get_reference_value(env_, callbackRef_, &callback); in OnThermalLevel() [all …]
|
/base/request/request/frameworks/js/napi/include/ |
D | async_call.h | 37 napi_delete_async_work(env_, work_); in ~Context() 38 napi_delete_reference(env_, self_); in ~Context() 40 napi_delete_reference(env_, callbackRef_); in ~Context() 62 return NapiUtils::CreateBusinessError(env_, error.code, error.errInfo, withErrCode_); in Creator() 69 napi_env env_; variable
|
/base/update/updater/services/applypatch/ |
D | data_writer.cpp | 28 UpdaterEnv *DataWriter::env_ = nullptr; member in Updater::DataWriter 76 return env_; in GetUpdaterEnv() 81 env_ = env; in SetUpdaterEnv() 87 env_ = env; in CreateDataWriter()
|
/base/request/request/frameworks/js/napi/src/legacy/ |
D | request_manager.cpp | 70 data->env_ = env; in CallFunctionAsync() 81 napi_open_handle_scope(data->env_, &scope); in CallFunctionAsync() 84 data->generator_(data->env_, &recv, argc, argv); in CallFunctionAsync() 86 napi_get_reference_value(data->env_, data->func_, &callback); in CallFunctionAsync() 88 napi_get_reference_value(data->env_, recv, &thiz); in CallFunctionAsync() 90 napi_call_function(data->env_, thiz, callback, argc, argv, &result); in CallFunctionAsync() 91 napi_delete_reference(data->env_, data->func_); in CallFunctionAsync() 92 napi_delete_reference(data->env_, recv); in CallFunctionAsync() 93 napi_close_handle_scope(data->env_, scope); in CallFunctionAsync() 114 CallFunctionAsync(descriptor.env_, descriptor.successCb_, in OnTaskDone() [all …]
|