Home
last modified time | relevance | path

Searched refs:env (Results 1 – 25 of 784) sorted by relevance

12345678910>>...32

/base/account/os_account/interfaces/kits/napi/account_iam/src/
Dnapi_account_iam_constant.cpp25 napi_value AuthTypeConstructor(napi_env env) in AuthTypeConstructor() argument
32 NAPI_CALL(env, napi_create_object(env, &authType)); in AuthTypeConstructor()
33 NAPI_CALL(env, napi_create_int32(env, static_cast<int32_t>(AuthType::PIN), &pin)); in AuthTypeConstructor()
34 NAPI_CALL(env, napi_create_int32(env, static_cast<int32_t>(AuthType::FACE), &face)); in AuthTypeConstructor()
35 … NAPI_CALL(env, napi_create_int32(env, static_cast<int32_t>(AuthType::FINGERPRINT), &fingerPrint)); in AuthTypeConstructor()
36 NAPI_CALL(env, napi_create_int32(env, static_cast<int32_t>(IAMAuthType::DOMAIN), &domain)); in AuthTypeConstructor()
37 NAPI_CALL(env, napi_set_named_property(env, authType, "PIN", pin)); in AuthTypeConstructor()
38 NAPI_CALL(env, napi_set_named_property(env, authType, "FACE", face)); in AuthTypeConstructor()
39 NAPI_CALL(env, napi_set_named_property(env, authType, "FINGERPRINT", fingerPrint)); in AuthTypeConstructor()
40 NAPI_CALL(env, napi_set_named_property(env, authType, "DOMAIN", domain)); in AuthTypeConstructor()
[all …]
/base/security/huks/interfaces/kits/napi/src/
Dhuks_napi.cpp45 inline void AddInt32Property(napi_env env, napi_value object, const char *name, int32_t value) in AddInt32Property() argument
48 NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, value, &property)); in AddInt32Property()
49 NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, object, name, property)); in AddInt32Property()
52 static void AddHuksTagPart1(napi_env env, napi_value tag) in AddHuksTagPart1() argument
55 AddInt32Property(env, tag, "HUKS_TAG_INVALID", HKS_TAG_INVALID); in AddHuksTagPart1()
58 AddInt32Property(env, tag, "HUKS_TAG_ALGORITHM", HKS_TAG_ALGORITHM); in AddHuksTagPart1()
59 AddInt32Property(env, tag, "HUKS_TAG_PURPOSE", HKS_TAG_PURPOSE); in AddHuksTagPart1()
60 AddInt32Property(env, tag, "HUKS_TAG_KEY_SIZE", HKS_TAG_KEY_SIZE); in AddHuksTagPart1()
61 AddInt32Property(env, tag, "HUKS_TAG_DIGEST", HKS_TAG_DIGEST); in AddHuksTagPart1()
62 AddInt32Property(env, tag, "HUKS_TAG_PADDING", HKS_TAG_PADDING); in AddHuksTagPart1()
[all …]
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
Dnapi_init.cpp41 static napi_value CreateCryptoMode(napi_env env) in CreateCryptoMode() argument
44 napi_create_object(env, &cryptoMode); in CreateCryptoMode()
46 AddUint32Property(env, cryptoMode, "ENCRYPT_MODE", ENCRYPT_MODE); in CreateCryptoMode()
47 AddUint32Property(env, cryptoMode, "DECRYPT_MODE", DECRYPT_MODE); in CreateCryptoMode()
51 static void DefineCryptoModeProperties(napi_env env, napi_value exports) in DefineCryptoModeProperties() argument
54 DECLARE_NAPI_PROPERTY("CryptoMode", CreateCryptoMode(env)), in DefineCryptoModeProperties()
56 napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); in DefineCryptoModeProperties()
60 static napi_value CreateResultCode(napi_env env) in CreateResultCode() argument
63 napi_create_object(env, &resultCode); in CreateResultCode()
65 AddUint32Property(env, resultCode, "INVALID_PARAMS", JS_ERR_INVALID_PARAMS); in CreateResultCode()
[all …]
/base/useriam/user_auth_framework/frameworks/js/napi/user_auth/src/
Duser_auth_entry.cpp39 napi_value UserAuthServiceConstructor(napi_env env, napi_callback_info info) in UserAuthServiceConstructor() argument
45 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, nullptr)); in UserAuthServiceConstructor()
49 napi_value GetVersion(napi_env env, napi_callback_info info) in GetVersion() argument
52 return UserAuthImpl::GetVersion(env, info); in GetVersion()
55 napi_value GetAvailableStatus(napi_env env, napi_callback_info info) in GetAvailableStatus() argument
58 return UserAuthImpl::GetAvailableStatus(env, info); in GetAvailableStatus()
61 napi_value GetAvailableStatusV9(napi_env env, napi_callback_info info) in GetAvailableStatusV9() argument
64 UserAuthResultCode result = AuthInstanceV9::GetAvailableStatus(env, info); in GetAvailableStatusV9()
67 napi_throw(env, UserAuthNapiHelper::GenerateBusinessErrorV9(env, result)); in GetAvailableStatusV9()
72 napi_status UnwrapAuthInstanceV9(napi_env env, napi_callback_info info, AuthInstanceV9 **authInstan… in UnwrapAuthInstanceV9() argument
[all …]
/base/telephony/call_manager/frameworks/js/napi/include/
Dnapi_call_manager.h28 #define GET_PARAMS(env, info, num) \ argument
33 napi_get_cb_info(env, info, &argc, argv, &thisVar, &data)
43 static napi_value DeclareCallBasisInterface(napi_env env, napi_value exports);
44 static napi_value DeclareCallConferenceInterface(napi_env env, napi_value exports);
45 static napi_value DeclareCallSupplementInterface(napi_env env, napi_value exports);
46 static napi_value DeclareCallExtendInterface(napi_env env, napi_value exports);
47 static napi_value DeclareCallMultimediaInterface(napi_env env, napi_value exports);
48 static napi_value DeclareCallImsInterface(napi_env env, napi_value exports);
49 static napi_value DeclareCallMediaEnum(napi_env env, napi_value exports);
50 static napi_value DeclareCallDialEnum(napi_env env, napi_value exports);
[all …]
/base/security/certificate_framework/frameworks/js/napi/certificate/src/
Dnapi_certificate_init.cpp32 static napi_value CreateEncodingFormat(napi_env env) in CreateEncodingFormat() argument
35 napi_create_object(env, &encodingFormat); in CreateEncodingFormat()
37 CertAddUint32Property(env, encodingFormat, "FORMAT_DER", CF_FORMAT_DER); in CreateEncodingFormat()
38 CertAddUint32Property(env, encodingFormat, "FORMAT_PEM", CF_FORMAT_PEM); in CreateEncodingFormat()
43 static void DefineEncodingFormatProperties(napi_env env, napi_value exports) in DefineEncodingFormatProperties() argument
46 DECLARE_NAPI_PROPERTY("EncodingFormat", CreateEncodingFormat(env)), in DefineEncodingFormatProperties()
48 napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); in DefineEncodingFormatProperties()
51 static napi_value CreateCertResultCode(napi_env env) in CreateCertResultCode() argument
54 napi_create_object(env, &resultCode); in CreateCertResultCode()
56 CertAddUint32Property(env, resultCode, "INVALID_PARAMS", JS_ERR_CERT_INVALID_PARAMS); in CreateCertResultCode()
[all …]
/base/customization/enterprise_device_management/interfaces/kits/wifi_manager/src/
Dwifi_manager_addon.cpp22 void WifiManagerAddon::CreateWifiSecurityTypeObject(napi_env env, napi_value value) in CreateWifiSecurityTypeObject() argument
25 …NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast<int32_t>(SecurityType::SEC_TYPE_INVA… in CreateWifiSecurityTypeObject()
26 …NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "WIFI_SEC_TYPE_INVALID", nInvalid)); in CreateWifiSecurityTypeObject()
28 …NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast<int32_t>(SecurityType::SEC_TYPE_OPEN… in CreateWifiSecurityTypeObject()
29 NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "WIFI_SEC_TYPE_OPEN", nOpen)); in CreateWifiSecurityTypeObject()
31 …NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast<int32_t>(SecurityType::SEC_TYPE_WEP)… in CreateWifiSecurityTypeObject()
32 NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "WIFI_SEC_TYPE_WEP", nWep)); in CreateWifiSecurityTypeObject()
34 …NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast<int32_t>(SecurityType::SEC_TYPE_PSK)… in CreateWifiSecurityTypeObject()
35 NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "WIFI_SEC_TYPE_PSK", nPsk)); in CreateWifiSecurityTypeObject()
37 …NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, static_cast<int32_t>(SecurityType::SEC_TYPE_SAE)… in CreateWifiSecurityTypeObject()
[all …]
/base/location/frameworks/js/napi/source/
Dlocation_napi_system.cpp31 napi_value GetLocationOnce(const napi_env& env, in GetLocationOnce() argument
37 NAPI_ASSERT(env, g_locatorImpl != nullptr, "get locator SA failed"); in GetLocationOnce()
47 if (env == g_systemSingleLocatorCallbackHost->GetEnv()) { in GetLocationOnce()
51 g_systemSingleLocatorCallbackHost->SetEnv(env); in GetLocationOnce()
57 return UndefinedNapiValue(env); in GetLocationOnce()
60 void GetAllCallback(const napi_env &env, const napi_value &argv, napi_ref &successHandlerRef, in GetAllCallback() argument
67 NAPI_CALL_RETURN_VOID(env, napi_has_named_property(env, argv, "success", &hasProperty)); in GetAllCallback()
69 … NAPI_CALL_RETURN_VOID(env, napi_get_named_property(env, argv, "success", &nVsuccessCallback)); in GetAllCallback()
70 … NAPI_CALL_RETURN_VOID(env, napi_create_reference(env, nVsuccessCallback, 1, &successHandlerRef)); in GetAllCallback()
73 NAPI_CALL_RETURN_VOID(env, napi_has_named_property(env, argv, "fail", &hasProperty)); in GetAllCallback()
[all …]
Dlocation_napi_adapter.cpp25 napi_value GetLastLocation(napi_env env, napi_callback_info info) in GetLastLocation() argument
33 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, &data)); in GetLastLocation()
34 NAPI_ASSERT(env, g_locatorClient != nullptr, "get locator SA failed"); in GetLastLocation()
37 return HandleGetCachedLocation(env); in GetLastLocation()
39 auto asyncContext = new (std::nothrow) LocationAsyncContext(env); in GetLastLocation()
40 NAPI_ASSERT(env, asyncContext != nullptr, "asyncContext is null."); in GetLastLocation()
41 …NAPI_CALL(env, napi_create_string_latin1(env, "getLastLocation", NAPI_AUTO_LENGTH, &asyncContext->… in GetLastLocation()
54 … NAPI_CALL_RETURN_VOID(context->env, napi_create_object(context->env, &context->result[PARAM1])); in GetLastLocation()
56 LocationToJs(context->env, context->loc, context->result[PARAM1]); in GetLastLocation()
64 return DoAsyncWork(env, asyncContext, argc, argv, objectArgsNum); in GetLastLocation()
[all …]
Dlocation_napi_entry.cpp25 napi_value LocationRequestPriorityTypeConstructor(napi_env env) in LocationRequestPriorityTypeConstructor() argument
28 NAPI_CALL(env, napi_create_object(env, &locationRequestPriority)); in LocationRequestPriorityTypeConstructor()
29 SetEnumPropertyByInteger(env, locationRequestPriority, PRIORITY_UNSET, "UNSET"); in LocationRequestPriorityTypeConstructor()
30 SetEnumPropertyByInteger(env, locationRequestPriority, PRIORITY_ACCURACY, "ACCURACY"); in LocationRequestPriorityTypeConstructor()
31 SetEnumPropertyByInteger(env, locationRequestPriority, PRIORITY_LOW_POWER, "LOW_POWER"); in LocationRequestPriorityTypeConstructor()
32 SetEnumPropertyByInteger(env, locationRequestPriority, PRIORITY_FAST_FIRST_FIX, "FIRST_FIX"); in LocationRequestPriorityTypeConstructor()
36 napi_value LocationRequestScenarioTypeConstructor(napi_env env) in LocationRequestScenarioTypeConstructor() argument
39 NAPI_CALL(env, napi_create_object(env, &locationRequestScenario)); in LocationRequestScenarioTypeConstructor()
40 SetEnumPropertyByInteger(env, locationRequestScenario, SCENE_UNSET, "UNSET"); in LocationRequestScenarioTypeConstructor()
41 SetEnumPropertyByInteger(env, locationRequestScenario, SCENE_NAVIGATION, "NAVIGATION"); in LocationRequestScenarioTypeConstructor()
[all …]
/base/security/access_token/interfaces/kits/privacy/napi/src/
Dpermission_record_manager_napi.cpp84 static void ParamResolveErrorThrow(const napi_env& env, const std::string& param, const std::string… in ParamResolveErrorThrow() argument
87 …NAPI_CALL_RETURN_VOID(env, napi_throw(env, GenerateBusinessError(env, JS_ERROR_PARAM_ILLEGAL, errM… in ParamResolveErrorThrow()
90 static void ReturnPromiseResult(napi_env env, const RecordManagerAsyncContext& context, napi_value … in ReturnPromiseResult() argument
94 napi_value businessError = GenerateBusinessError(env, jsCode, GetErrorMessage(jsCode)); in ReturnPromiseResult()
95 NAPI_CALL_RETURN_VOID(env, napi_reject_deferred(env, context.deferred, businessError)); in ReturnPromiseResult()
97 NAPI_CALL_RETURN_VOID(env, napi_resolve_deferred(env, context.deferred, result)); in ReturnPromiseResult()
101 static void ReturnCallbackResult(napi_env env, const RecordManagerAsyncContext& context, napi_value… in ReturnCallbackResult() argument
103 napi_value businessError = GetNapiNull(env); in ReturnCallbackResult()
106 businessError = GenerateBusinessError(env, jsCode, GetErrorMessage(jsCode)); in ReturnCallbackResult()
113 NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &thisValue)); in ReturnCallbackResult()
[all …]
/base/notification/common_event_service/interfaces/kits/napi/support/src/
Dsupport.cpp21 void SetNamedPropertyByStr(napi_env env, napi_value dstObj, const std::string &objName, const char … in SetNamedPropertyByStr() argument
24 if (napi_create_string_utf8(env, objName.c_str(), NAPI_AUTO_LENGTH, &prop) == napi_ok) { in SetNamedPropertyByStr()
25 napi_set_named_property(env, dstObj, propName, prop); in SetNamedPropertyByStr()
29 napi_value SupportInit(napi_env env, napi_value exports) in SupportInit() argument
32 napi_create_object(env, &obj); in SupportInit()
35env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BOOT_COMPLETED, "COMMON_EVENT_BOOT_COMPLETED"… in SupportInit()
36 SetNamedPropertyByStr(env, in SupportInit()
40 …SetNamedPropertyByStr(env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_SHUTDOWN, "COMMON_EVENT… in SupportInit()
42env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BATTERY_CHANGED, "COMMON_EVENT_BATTERY_CHANGE… in SupportInit()
43 …SetNamedPropertyByStr(env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BATTERY_LOW, "COMMON_EV… in SupportInit()
[all …]
/base/location/frameworks/native/source/
Dnapi_util.cpp32 napi_value UndefinedNapiValue(const napi_env& env) in UndefinedNapiValue() argument
35 NAPI_CALL(env, napi_get_undefined(env, &result)); in UndefinedNapiValue()
39 void SatelliteStatusToJs(const napi_env& env, in SatelliteStatusToJs() argument
47 SetValueDouble(env, "satellitesNumber", statusInfo->GetSatellitesNumber(), result); in SatelliteStatusToJs()
49 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
50 … napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &satelliteIdsArray)); in SatelliteStatusToJs()
51 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
52 napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &cn0Array)); in SatelliteStatusToJs()
53 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
54 napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &altitudesArray)); in SatelliteStatusToJs()
[all …]
/base/sensors/sensor/interfaces/plugin/src/
Dsensor_napi_utils.cpp29 bool IsSameValue(const napi_env &env, const napi_value &lhs, const napi_value &rhs) in IsSameValue() argument
33 CHKNRF(env, napi_strict_equals(env, lhs, rhs, &result), "napi_strict_equals"); in IsSameValue()
37 bool IsMatchType(const napi_env &env, const napi_value &value, const napi_valuetype &type) in IsMatchType() argument
41 CHKNRF(env, napi_typeof(env, value, &paramType), "napi_typeof"); in IsMatchType()
45 bool IsMatchArrayType(const napi_env &env, const napi_value &value) in IsMatchArrayType() argument
49 CHKNRF(env, napi_is_array(env, value, &result), "napi_is_array"); in IsMatchArrayType()
53 bool GetFloatArray(const napi_env &env, const napi_value &value, vector<float> &array) in GetFloatArray() argument
57 CHKNRF(env, napi_get_array_length(env, value, &arrayLength), "napi_get_array_length"); in GetFloatArray()
60 CHKNRF(env, napi_get_element(env, value, i, &element), "napi_get_element"); in GetFloatArray()
61 …CHKNCF(env, IsMatchType(env, element, napi_number), "Wrong argument type. Number or function expec… in GetFloatArray()
[all …]
Dsensor_system_js.cpp22 napi_value SubscribeAccelerometer(napi_env env, napi_callback_info info) in SubscribeAccelerometer() argument
25 return Subscribe(env, info, SENSOR_TYPE_ID_ACCELEROMETER, SUBSCRIBE_CALLBACK); in SubscribeAccelerometer()
28 napi_value UnsubscribeAccelerometer(napi_env env, napi_callback_info info) in UnsubscribeAccelerometer() argument
31 return Unsubscribe(env, info, SENSOR_TYPE_ID_ACCELEROMETER); in UnsubscribeAccelerometer()
34 napi_value SubscribeCompass(napi_env env, napi_callback_info info) in SubscribeCompass() argument
37 return Subscribe(env, info, SENSOR_TYPE_ID_ORIENTATION, SUBSCRIBE_COMPASS); in SubscribeCompass()
40 napi_value UnsubscribeCompass(napi_env env, napi_callback_info info) in UnsubscribeCompass() argument
43 return Unsubscribe(env, info, SENSOR_TYPE_ID_ORIENTATION); in UnsubscribeCompass()
46 napi_value SubscribeProximity(napi_env env, napi_callback_info info) in SubscribeProximity() argument
49 return Subscribe(env, info, SENSOR_TYPE_ID_PROXIMITY, SUBSCRIBE_CALLBACK); in SubscribeProximity()
[all …]
/base/notification/distributed_notification_service/frameworks/js/napi/src/
Dcommon.cpp53 napi_value Common::NapiGetBoolean(napi_env env, const bool &isValue) in NapiGetBoolean() argument
56 napi_get_boolean(env, isValue, &result); in NapiGetBoolean()
60 napi_value Common::NapiGetNull(napi_env env) in NapiGetNull() argument
63 napi_get_null(env, &result); in NapiGetNull()
67 napi_value Common::NapiGetUndefined(napi_env env) in NapiGetUndefined() argument
70 napi_get_undefined(env, &result); in NapiGetUndefined()
74 napi_value Common::CreateErrorValue(napi_env env, int32_t errCode, bool newType) in CreateErrorValue() argument
77 napi_value error = Common::NapiGetNull(env); in CreateErrorValue()
83 napi_create_int32(env, errCode, &code); in CreateErrorValue()
88 napi_create_string_utf8(env, errMsg.c_str(), NAPI_AUTO_LENGTH, &message); in CreateErrorValue()
[all …]
Dconstant.cpp22 void SetNamedPropertyByInteger(napi_env env, napi_value dstObj, int32_t objName, const char *propNa… in SetNamedPropertyByInteger() argument
25 if (napi_create_int32(env, objName, &prop) == napi_ok) { in SetNamedPropertyByInteger()
26 napi_set_named_property(env, dstObj, propName, prop); in SetNamedPropertyByInteger()
30 napi_value RemoveReasonInit(napi_env env, napi_value exports) in RemoveReasonInit() argument
35 napi_create_object(env, &obj); in RemoveReasonInit()
37 …SetNamedPropertyByInteger(env, obj, (int32_t)RemoveReason::CLICK_REASON_REMOVE, "CLICK_REASON_REMO… in RemoveReasonInit()
38 …SetNamedPropertyByInteger(env, obj, (int32_t)RemoveReason::CANCEL_REASON_REMOVE, "CANCEL_REASON_RE… in RemoveReasonInit()
44 napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs); in RemoveReasonInit()
48 napi_value SlotTypeInit(napi_env env, napi_value exports) in SlotTypeInit() argument
53 napi_create_object(env, &obj); in SlotTypeInit()
[all …]
/base/account/os_account/interfaces/kits/napi/appaccount/src/
Dnapi_app_account.cpp109 napi_value NapiAppAccount::Init(napi_env env, napi_value exports) in Init() argument
115env, napi_define_properties(env, exports, sizeof(descriptor) / sizeof(napi_property_descriptor), d… in Init()
118 NAPI_CALL(env, in Init()
119 …napi_define_class(env, APP_ACCOUNT_CLASS_NAME.c_str(), APP_ACCOUNT_CLASS_NAME.size(), JsConstructo… in Init()
121 NAPI_CALL(env, napi_create_reference(env, cons, 1, &appAccountRef_)); in Init()
122 NAPI_CALL(env, napi_set_named_property(env, exports, APP_ACCOUNT_CLASS_NAME.c_str(), cons)); in Init()
126 napi_value NapiAppAccount::JsConstructor(napi_env env, napi_callback_info cbInfo) in JsConstructor() argument
129 NAPI_CALL(env, napi_get_cb_info(env, cbInfo, nullptr, nullptr, &thisVar, nullptr)); in JsConstructor()
133 napi_value NapiAppAccount::CreateAppAccountManager(napi_env env, napi_callback_info cbInfo) in CreateAppAccountManager() argument
137 if (napi_get_reference_value(env, appAccountRef_, &cons) != napi_ok) { in CreateAppAccountManager()
[all …]
Dnapi_app_account_constant.cpp25 static void ResultCodeInit(napi_env env, napi_value *resultCode) in ResultCodeInit() argument
27 SetNamedProperty(env, (*resultCode), ERR_JS_SUCCESS_V8, "SUCCESS"); in ResultCodeInit()
28 SetNamedProperty(env, (*resultCode), ERR_JS_ACCOUNT_NOT_EXIST, "ERROR_ACCOUNT_NOT_EXIST"); in ResultCodeInit()
29 …SetNamedProperty(env, (*resultCode), ERR_JS_APP_ACCOUNT_SERVICE_EXCEPTION, "ERROR_APP_ACCOUNT_SERV… in ResultCodeInit()
30 SetNamedProperty(env, (*resultCode), ERR_JS_INVALID_PASSWORD, "ERROR_INVALID_PASSWORD"); in ResultCodeInit()
31 SetNamedProperty(env, (*resultCode), ERR_JS_INVALID_REQUEST, "ERROR_INVALID_REQUEST"); in ResultCodeInit()
32 SetNamedProperty(env, (*resultCode), ERR_JS_INVALID_RESPONSE, "ERROR_INVALID_RESPONSE"); in ResultCodeInit()
33 SetNamedProperty(env, (*resultCode), ERR_JS_NETWORK_EXCEPTION, "ERROR_NETWORK_EXCEPTION"); in ResultCodeInit()
34 …SetNamedProperty(env, (*resultCode), ERR_JS_OAUTH_AUTHENTICATOR_NOT_EXIST, "ERROR_OAUTH_AUTHENTICA… in ResultCodeInit()
35 SetNamedProperty(env, (*resultCode), ERR_JS_OAUTH_CANCELED, "ERROR_OAUTH_CANCELED"); in ResultCodeInit()
[all …]
/base/security/dlp_permission_service/interfaces/kits/napi_common/src/
Dnapi_common.cpp32 static bool ConvertDlpSandboxChangeInfo(napi_env env, napi_value value, const DlpSandboxCallbackInf… in ConvertDlpSandboxChangeInfo() argument
35 NAPI_CALL_BASE(env, napi_create_int32(env, result.appIndex, &element), false); in ConvertDlpSandboxChangeInfo()
36 NAPI_CALL_BASE(env, napi_set_named_property(env, value, "appIndex", element), false); in ConvertDlpSandboxChangeInfo()
38 …NAPI_CALL_BASE(env, napi_create_string_utf8(env, result.bundleName.c_str(), NAPI_AUTO_LENGTH, &ele… in ConvertDlpSandboxChangeInfo()
39 NAPI_CALL_BASE(env, napi_set_named_property(env, value, "bundleName", element), false); in ConvertDlpSandboxChangeInfo()
55 napi_open_handle_scope(registerSandboxChangeData->env, &scope); in UvQueueWorkDlpSandboxChanged()
61 NAPI_CALL_RETURN_VOID_WITH_SCOPE(registerSandboxChangeData->env, in UvQueueWorkDlpSandboxChanged()
62 napi_create_array(registerSandboxChangeData->env, &result), scope); in UvQueueWorkDlpSandboxChanged()
63 …if (!ConvertDlpSandboxChangeInfo(registerSandboxChangeData->env, result, registerSandboxChangeData… in UvQueueWorkDlpSandboxChanged()
64 napi_close_handle_scope(registerSandboxChangeData->env, scope); in UvQueueWorkDlpSandboxChanged()
[all …]
/base/security/dlp_permission_service/interfaces/kits/dlp_permission/napi/include/
Dnapi_dlp_permission.h34 static napi_value Init(napi_env env, napi_value exports);
37 static napi_value JsConstructor(napi_env env, napi_callback_info cbinfo);
38 static napi_value DlpFile(napi_env env, napi_callback_info cbInfo);
39 static bool IsSystemApp(napi_env env);
41 static void GenerateDlpFileExcute(napi_env env, void* data);
42 static void GenerateDlpFileComplete(napi_env env, napi_status status, void* data);
43 static napi_value GenerateDlpFile(napi_env env, napi_callback_info cbInfo);
45 static void OpenDlpFileExcute(napi_env env, void* data);
46 static void OpenDlpFileComplete(napi_env env, napi_status status, void* data);
47 static napi_value OpenDlpFile(napi_env env, napi_callback_info cbInfo);
[all …]
/base/account/os_account/interfaces/kits/napi/osaccount/include/
Dnapi_os_account_common.h42 NapiCreateDomainCallback(napi_env env, napi_ref callbackRef, napi_deferred deferred);
52 napi_value WrapVoidToJS(napi_env env);
54 bool ParseParaQueryOAByIdCB(napi_env env, napi_callback_info cbInfo, QueryOAByIdAsyncContext *async…
56 void QueryOAByIdExecuteCB(napi_env env, void *data);
58 void QueryOAByIdCallbackCompletedCB(napi_env env, napi_status status, void *data);
60 void GetOACBInfoToJs(napi_env env, OsAccountInfo &info, napi_value &objOAInfo);
62 void MakeArrayToJs(napi_env env, const std::vector<std::string> &constraints, napi_value jsArray);
64 bool ParseParaRemoveOACB(napi_env env, napi_callback_info cbInfo, RemoveOAAsyncContext *asyncContex…
66 void RemoveOAExecuteCB(napi_env env, void *data);
68 void RemoveOACallbackCompletedCB(napi_env env, napi_status status, void *data);
[all …]
/base/global/i18n/interfaces/js/kits/include/
Di18n_addon.h36 void GetOptionMap(napi_env env, napi_value argv, std::map<std::string, std::string> &map);
37 void GetOptionValue(napi_env env, napi_value options, const std::string &optionName,
39 bool CheckNapiValueType(napi_env env, napi_value value);
43 static napi_value Init(napi_env env, napi_value exports);
44 static void Destructor(napi_env env, void *nativeObject, void *finalize_hint);
47 static napi_value GetSystemLanguages(napi_env env, napi_callback_info info);
48 static napi_value GetSystemCountries(napi_env env, napi_callback_info info);
49 static napi_value GetSystemCountriesWithError(napi_env env, napi_callback_info info);
50 static napi_value IsSuggested(napi_env env, napi_callback_info info);
51 static napi_value IsSuggestedWithError(napi_env env, napi_callback_info info);
[all …]
/base/account/os_account/interfaces/kits/napi/appaccount/include/
Dnapi_app_account.h25 static napi_value Init(napi_env env, napi_value exports);
29 static napi_value CreateAppAccountManager(napi_env env, napi_callback_info cbInfo);
30 static napi_value AddAccount(napi_env env, napi_callback_info cbInfo);
31 static napi_value AddAccountImplicitly(napi_env env, napi_callback_info cbInfo);
32 static napi_value DeleteAccount(napi_env env, napi_callback_info cbInfo);
33 static napi_value DisableAppAccess(napi_env env, napi_callback_info cbInfo);
34 static napi_value EnableAppAccess(napi_env env, napi_callback_info cbInfo);
35 static napi_value CheckAppAccountSyncEnable(napi_env env, napi_callback_info cbInfo);
36 static napi_value SetAccountCredential(napi_env env, napi_callback_info cbInfo);
37 static napi_value SetAccountExtraInfo(napi_env env, napi_callback_info cbInfo);
[all …]
/base/time/time_service/framework/js/napi/common/src/
Dnapi_utils.cpp42 napi_value NapiUtils::CreateNapiNumber(napi_env env, int32_t objName) in CreateNapiNumber() argument
45 napi_create_int32(env, objName, &prop); in CreateNapiNumber()
49 napi_value NapiUtils::GetUndefinedValue(napi_env env) in GetUndefinedValue() argument
52 napi_get_undefined(env, &result); in GetUndefinedValue()
56 napi_status NapiUtils::GetValue(napi_env env, napi_value in, std::string &out) in GetValue() argument
59 napi_status status = napi_typeof(env, in, &type); in GetValue()
62 napi_get_value_string_utf8(env, in, nullptr, 0, &maxLen); in GetValue()
68 status = napi_get_value_string_utf8(env, in, buf, maxLen + STR_TAIL_LENGTH, &len); in GetValue()
75 napi_status NapiUtils::ThrowError(napi_env env, const char *napiMessage, int32_t napiCode) in ThrowError() argument
80 napi_create_string_utf8(env, napiMessage, NAPI_AUTO_LENGTH, &message); in ThrowError()
[all …]

12345678910>>...32