Feat: 安全告警代码整改0614

Signed-off-by: yangziyong <nsyangziyong@huawei.com>
Change-Id: Ia10fb3aa3ae15ca6c313e70801966b8025e0401d
This commit is contained in:
yangziyong 2024-06-15 13:40:48 +08:00
parent 776e8612f7
commit 5ff5035249
14 changed files with 16 additions and 15 deletions

View File

@ -511,7 +511,7 @@ bool JsiCallbackInfo::GetDoubleArrayArg(size_t index, std::vector<double>& value
return false; return false;
} }
auto arrayRef = Local<ArrayRef>(arg); auto arrayRef = Local<ArrayRef>(arg);
int32_t length = arrayRef->Length(info_->GetVM()); uint32_t length = arrayRef->Length(info_->GetVM());
valueArr.reserve(length); valueArr.reserve(length);
for (int32_t i = 0; i < length; ++i) { for (int32_t i = 0; i < length; ++i) {
auto jsDouble = panda::ArrayRef::GetValueAt(info_->GetVM(), arrayRef, i); auto jsDouble = panda::ArrayRef::GetValueAt(info_->GetVM(), arrayRef, i);

View File

@ -50,7 +50,7 @@ ArkUINativeModuleValue ParticleBridge::SetDisturbanceField(ArkUIRuntimeCallInfo*
ArkTSUtils::ParseJsInteger(vm, strength, strengthValue); ArkTSUtils::ParseJsInteger(vm, strength, strengthValue);
dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_0].f32 = static_cast<float>(strengthValue); dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_0].f32 = static_cast<float>(strengthValue);
Local<JSValueRef> shape = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_1); Local<JSValueRef> shape = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_1);
uint32_t shapeValue = 0; int32_t shapeValue = 0;
ArkTSUtils::ParseJsInteger(vm, shape, shapeValue); ArkTSUtils::ParseJsInteger(vm, shape, shapeValue);
dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_1].i32 = shapeValue; dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_1].i32 = shapeValue;
Local<JSValueRef> sizeWidth = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_2); Local<JSValueRef> sizeWidth = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_2);

View File

@ -158,7 +158,7 @@ ArkUINativeModuleValue RelativeContainerBridge::SetBarrier(ArkUIRuntimeCallInfo*
} }
if (referencedIdVal->IsArray(vm)) { if (referencedIdVal->IsArray(vm)) {
auto array = panda::Local<panda::ArrayRef>(referencedIdVal); auto array = panda::Local<panda::ArrayRef>(referencedIdVal);
int32_t referenceSize = array->Length(vm); uint32_t referenceSize = array->Length(vm);
std::vector<ArkUI_CharPtr> referencedIds; std::vector<ArkUI_CharPtr> referencedIds;
ParseReferencedId(vm, referenceSize, array, referencedIds); ParseReferencedId(vm, referenceSize, array, referencedIds);
info.referencedId = referencedIds.data(); info.referencedId = referencedIds.data();

View File

@ -54,7 +54,7 @@ DataPanelModel* DataPanelModel::GetInstance()
} // namespace OHOS::Ace } // namespace OHOS::Ace
namespace OHOS::Ace::Framework { namespace OHOS::Ace::Framework {
namespace { namespace {
constexpr int32_t TYPE_CYCLE = 0; constexpr uint32_t TYPE_CYCLE = 0;
bool CheckJSCallbackInfo( bool CheckJSCallbackInfo(
const std::string& callerName, const JSCallbackInfo& info, std::vector<JSCallbackInfoType>& infoTypes) const std::string& callerName, const JSCallbackInfo& info, std::vector<JSCallbackInfoType>& infoTypes)
@ -105,7 +105,7 @@ bool CheckJSCallbackInfo(
} }
constexpr size_t MAX_COUNT = 9; constexpr size_t MAX_COUNT = 9;
int32_t JSDataPanel::dataPanelType_ = 0; uint32_t JSDataPanel::dataPanelType_ = 0;
void JSDataPanel::JSBind(BindingTarget globalObj) void JSDataPanel::JSBind(BindingTarget globalObj)
{ {

View File

@ -34,7 +34,7 @@ private:
static bool ConvertGradientColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient); static bool ConvertGradientColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient);
static bool ConvertResourceColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient); static bool ConvertResourceColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient);
static void ConvertThemeColor(std::vector<OHOS::Ace::NG::Gradient>& colors); static void ConvertThemeColor(std::vector<OHOS::Ace::NG::Gradient>& colors);
static int32_t dataPanelType_; static uint32_t dataPanelType_;
}; };
} // namespace OHOS::Ace::Framework } // namespace OHOS::Ace::Framework
#endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_DATA_PANEL_H #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_DATA_PANEL_H

View File

@ -1241,7 +1241,7 @@ void JSParagraphStyleSpan::ParseJsWordBreak(const JSRef<JSObject>& obj, SpanPara
return; return;
} }
JSRef<JSVal> args = obj->GetProperty("wordBreak"); JSRef<JSVal> args = obj->GetProperty("wordBreak");
uint32_t index = WORD_BREAK_TYPES_DEFAULT; int32_t index = WORD_BREAK_TYPES_DEFAULT;
if (args->IsNumber()) { if (args->IsNumber()) {
index = args->ToNumber<int32_t>(); index = args->ToNumber<int32_t>();
} }

View File

@ -234,7 +234,7 @@ void EventManager::RecordHitEmptyMessage(
auto hitEmptyMessage = JsonUtil::Create(true); auto hitEmptyMessage = JsonUtil::Create(true);
auto container = Container::Current(); auto container = Container::Current();
CHECK_NULL_VOID(container); CHECK_NULL_VOID(container);
auto windowId = 0; uint32_t windowId = 0;
#ifdef WINDOW_SCENE_SUPPORTED #ifdef WINDOW_SCENE_SUPPORTED
windowId = NG::WindowSceneHelper::GetWindowIdForWindowScene(frameNode); windowId = NG::WindowSceneHelper::GetWindowIdForWindowScene(frameNode);
#endif #endif

View File

@ -4504,7 +4504,8 @@ void WebDelegate::OnPermissionRequestPrompt(const std::shared_ptr<OHOS::NWeb::NW
[weak = WeakClaim(this), request]() { [weak = WeakClaim(this), request]() {
auto delegate = weak.Upgrade(); auto delegate = weak.Upgrade();
CHECK_NULL_VOID(delegate); CHECK_NULL_VOID(delegate);
if (request->ResourceAcessId() & OHOS::NWeb::NWebAccessRequest::Resources::CLIPBOARD_READ_WRITE) { if (static_cast<uint32_t>(request->ResourceAcessId())
& OHOS::NWeb::NWebAccessRequest::Resources::CLIPBOARD_READ_WRITE) {
auto webPattern = delegate->webPattern_.Upgrade(); auto webPattern = delegate->webPattern_.Upgrade();
CHECK_NULL_VOID(webPattern); CHECK_NULL_VOID(webPattern);
auto clipboardCallback = webPattern->GetPermissionClipboardCallback(); auto clipboardCallback = webPattern->GetPermissionClipboardCallback();

View File

@ -552,7 +552,7 @@ void TextFieldContentModifier::ModifyDecorationInTextStyle(TextStyle& textStyle)
void TextFieldContentModifier::UpdateTextDecorationMeasureFlag(PropertyChangeFlag& flag) void TextFieldContentModifier::UpdateTextDecorationMeasureFlag(PropertyChangeFlag& flag)
{ {
if (textDecoration_.has_value() && textDecorationColor_.has_value() && textDecorationColorAlpha_) { if (textDecoration_.has_value() && textDecorationColor_.has_value() && textDecorationColorAlpha_) {
uint8_t alpha = static_cast<int>(std::floor(textDecorationColorAlpha_->Get() + ROUND_VALUE)); uint8_t alpha = static_cast<uint32_t>(std::floor(textDecorationColorAlpha_->Get() + ROUND_VALUE));
if (textDecoration_.value() == TextDecoration::UNDERLINE && alpha != textDecorationColor_.value().GetAlpha()) { if (textDecoration_.value() == TextDecoration::UNDERLINE && alpha != textDecorationColor_.value().GetAlpha()) {
flag |= PROPERTY_UPDATE_MEASURE; flag |= PROPERTY_UPDATE_MEASURE;
} else if (textDecoration_.value() == TextDecoration::NONE && alpha != 0.0) { } else if (textDecoration_.value() == TextDecoration::NONE && alpha != 0.0) {

View File

@ -90,7 +90,7 @@ private:
bool needPaintSelect_ = false; bool needPaintSelect_ = false;
bool needPaintPreviewText = false; bool needPaintPreviewText = false;
PreviewTextStyle previewTextStyle_; PreviewTextStyle previewTextStyle_ = PreviewTextStyle::NORMAL;
WeakPtr<Pattern> pattern_; WeakPtr<Pattern> pattern_;
WeakPtr<ScrollBar> scrollBar_; WeakPtr<ScrollBar> scrollBar_;
WeakPtr<ScrollEdgeEffect> edgeEffect_; WeakPtr<ScrollEdgeEffect> edgeEffect_;

View File

@ -183,7 +183,7 @@ private:
#endif #endif
std::u16string text_; std::u16string text_;
int32_t placeholderCnt_ = 0; int32_t placeholderCnt_ = 0;
TextAlign textAlign_; TextAlign textAlign_ = TextAlign::START;
static uint32_t destructCount; static uint32_t destructCount;
std::list<size_t> placeholderPosition_; std::list<size_t> placeholderPosition_;
bool hasExternalParagraph_ = false; bool hasExternalParagraph_ = false;

View File

@ -3519,7 +3519,7 @@ void SetDragPreviewOptions(ArkUINodeHandle node, ArkUIDragPreViewOptions dragPre
if (!dragPreviewOptions.isModeArray) { if (!dragPreviewOptions.isModeArray) {
ParseDragPreviewMode(option, dragPreviewOptions.mode, isAuto); ParseDragPreviewMode(option, dragPreviewOptions.mode, isAuto);
} else { } else {
for (size_t i = 0; i < dragPreviewOptions.modeArrayLength; i++) { for (int32_t i = 0; i < dragPreviewOptions.modeArrayLength; i++) {
ParseDragPreviewMode(option, dragPreviewOptions.modeArray[i], isAuto); ParseDragPreviewMode(option, dragPreviewOptions.modeArray[i], isAuto);
if (isAuto) { if (isAuto) {
break; break;

View File

@ -77,7 +77,7 @@ void SetListItemGroupChildrenMainSize(ArkUINodeHandle node, ArkUIListChildrenMai
{ {
auto* frameNode = reinterpret_cast<FrameNode*>(node); auto* frameNode = reinterpret_cast<FrameNode*>(node);
CHECK_NULL_VOID(frameNode); CHECK_NULL_VOID(frameNode);
for (int i = 0; i < option->mainSize.size(); i++) { for (uint32_t i = 0; i < option->mainSize.size(); i++) {
if (option->mainSize[i] > 0) { if (option->mainSize[i] > 0) {
option->mainSize[i] = option->mainSize[i] =
Dimension(option->mainSize[i], static_cast<OHOS::Ace::DimensionUnit>(unit)).ConvertToPx(); Dimension(option->mainSize[i], static_cast<OHOS::Ace::DimensionUnit>(unit)).ConvertToPx();

View File

@ -255,7 +255,7 @@ int32_t OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(
float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize* option, int32_t index) float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize* option, int32_t index)
{ {
CHECK_NULL_RETURN(option, -1); CHECK_NULL_RETURN(option, -1);
if (index < 0 || option->mainSize.size() - 1 < index) { if (index < 0 || option->mainSize.size() - 1 < static_cast<uint32_t>(index)) {
return -1; return -1;
} }
return option->mainSize[index]; return option->mainSize[index];