From c7b6a25f649c2fb6bfa9a0c872bd331002ae3574 Mon Sep 17 00:00:00 2001 From: lijiancheng21 Date: Mon, 8 Sep 2025 16:59:23 +0800 Subject: [PATCH] Revise code review renderEngine Signed-off-by: lijiancheng21 --- .../ani/webview/ets/@ohos.web.webview.ets | 5 +- .../native_media_player_impl.cpp | 79 +++++++++----- .../webviewcontroller/webview_controller.cpp | 18 +++- .../webviewcontroller/webview_controller.h | 2 +- .../webview_hasimage_callback.cpp | 3 +- .../webview/src/common/ani_parse_utils.cpp | 13 ++- .../ani_geolocation_permission.cpp | 2 +- .../webdatabase/ani_geolocation_permission.h | 3 +- .../src/webdatabase/ani_web_data_base.cpp | 3 +- .../ani_native_media_player_handler.cpp | 74 +++++++------ .../ani_webview_controller.cpp | 100 ++++++++++++------ ...ani_webview_createpdf_execute_callback.cpp | 2 +- .../ani_webview_createpdf_execute_callback.h | 2 +- 13 files changed, 196 insertions(+), 110 deletions(-) diff --git a/interfaces/kits/ani/webview/ets/@ohos.web.webview.ets b/interfaces/kits/ani/webview/ets/@ohos.web.webview.ets index f4cd676c4..295814260 100644 --- a/interfaces/kits/ani/webview/ets/@ohos.web.webview.ets +++ b/interfaces/kits/ani/webview/ets/@ohos.web.webview.ets @@ -744,7 +744,7 @@ export default namespace webview { } else if (script instanceof Uint8Array) { resScript = script.buffer as ArrayBuffer; } - return this.precompileJavaScriptInternal(url,resScript,cacheOptions); + return this.precompileJavaScriptInternal(url, resScript, cacheOptions); } native runJavaScriptCallback(script: string, callback: AsyncCallback): void; runJavaScript(script: string, callback: AsyncCallback): void { @@ -1638,7 +1638,6 @@ export default namespace webview { } native constructor(); - native static existHttpAuthCredentials(): boolean; native static deleteHttpAuthCredentials(): void; native static getHttpAuthCredentials(host: string, realm: string): Array; @@ -1700,8 +1699,6 @@ export default namespace webview { GeolocationPermissions.allowGeolocation_inner(origin,incognitoMode); } - - static getStoredGeolocation(incognito?: boolean):Promise>{ let incognitoMode:boolean = false; if(incognito !== undefined) diff --git a/interfaces/kits/ani/webview/native/webviewcontroller/native_media_player_impl.cpp b/interfaces/kits/ani/webview/native/webviewcontroller/native_media_player_impl.cpp index 688b9d78e..a83462467 100644 --- a/interfaces/kits/ani/webview/native/webviewcontroller/native_media_player_impl.cpp +++ b/interfaces/kits/ani/webview/native/webviewcontroller/native_media_player_impl.cpp @@ -113,7 +113,14 @@ NWebNativeMediaPlayerBridgeImpl::NWebNativeMediaPlayerBridgeImpl(int32_t nwebId, if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; } - env->GlobalReference_Create(value, &value_); + if (env == nullptr) { + WVLOG_E("env is nulptr"); + return; + } + ani_status status = env->GlobalReference_Create(value, &value_); + if (status != ANI_OK) { + WVLOG_E("nwebNativeMediaPlayerBridgeImpl create reference failed."); + } } NWebNativeMediaPlayerBridgeImpl::~NWebNativeMediaPlayerBridgeImpl() @@ -122,12 +129,19 @@ NWebNativeMediaPlayerBridgeImpl::~NWebNativeMediaPlayerBridgeImpl() if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; } - env->GlobalReference_Delete(value_); + if (env == nullptr) { + WVLOG_E("env is nulptr"); + return; + } + ani_status status = env->GlobalReference_Delete(value_); + if (status != ANI_OK) { + WVLOG_E("nwebNativeMediaPlayerBridgeImpl delete reference failed."); + } } void NWebNativeMediaPlayerBridgeImpl::UpdateRect(double x, double y, double width, double height) { - WVLOG_I("begin to update rect, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to update rect, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -145,7 +159,7 @@ void NWebNativeMediaPlayerBridgeImpl::UpdateRect(double x, double y, double widt void NWebNativeMediaPlayerBridgeImpl::Play() { - WVLOG_I("begin to play, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to play, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -158,7 +172,7 @@ void NWebNativeMediaPlayerBridgeImpl::Play() void NWebNativeMediaPlayerBridgeImpl::Pause() { - WVLOG_I("begin to pause, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to pause, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -171,7 +185,7 @@ void NWebNativeMediaPlayerBridgeImpl::Pause() void NWebNativeMediaPlayerBridgeImpl::Seek(double time) { - WVLOG_I("begin to seek, nweb id is %{public}d, time is %{public}f", nwebId_, time); + WVLOG_D("begin to seek, nweb id is %{public}d, time is %{public}f", nwebId_, time); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -185,7 +199,7 @@ void NWebNativeMediaPlayerBridgeImpl::Seek(double time) void NWebNativeMediaPlayerBridgeImpl::SetVolume(double volume) { - WVLOG_I("begin to set volume, nweb id is %{public}d, volume is %{public}f", nwebId_, volume); + WVLOG_D("begin to set volume, nweb id is %{public}d, volume is %{public}f", nwebId_, volume); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -199,7 +213,7 @@ void NWebNativeMediaPlayerBridgeImpl::SetVolume(double volume) void NWebNativeMediaPlayerBridgeImpl::SetMuted(bool isMuted) { - WVLOG_I("begin to set muted, nweb id is %{public}d, muted flag is %{public}d", nwebId_, isMuted); + WVLOG_D("begin to set muted, nweb id is %{public}d, muted flag is %{public}d", nwebId_, isMuted); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -213,7 +227,7 @@ void NWebNativeMediaPlayerBridgeImpl::SetMuted(bool isMuted) void NWebNativeMediaPlayerBridgeImpl::SetPlaybackRate(double playbackRate) { - WVLOG_I("begin to set playback rate, nweb id is %{public}d, playback rate is %{public}f", nwebId_, playbackRate); + WVLOG_D("begin to set playback rate, nweb id is %{public}d, playback rate is %{public}f", nwebId_, playbackRate); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -227,7 +241,7 @@ void NWebNativeMediaPlayerBridgeImpl::SetPlaybackRate(double playbackRate) void NWebNativeMediaPlayerBridgeImpl::Release() { - WVLOG_I("begin to release, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to release, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -239,7 +253,7 @@ void NWebNativeMediaPlayerBridgeImpl::Release() void NWebNativeMediaPlayerBridgeImpl::EnterFullScreen() { - WVLOG_I("begin to enter full screen, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to enter full screen, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -251,7 +265,7 @@ void NWebNativeMediaPlayerBridgeImpl::EnterFullScreen() void NWebNativeMediaPlayerBridgeImpl::ExitFullScreen() { - WVLOG_I("begin to exit full screen, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to exit full screen, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -263,7 +277,7 @@ void NWebNativeMediaPlayerBridgeImpl::ExitFullScreen() void NWebNativeMediaPlayerBridgeImpl::ResumeMediaPlayer() { - WVLOG_I("begin to resume media player, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to resume media player, nweb id is %{public}d", nwebId_); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -284,7 +298,7 @@ void NWebNativeMediaPlayerBridgeImpl::ResumeMediaPlayer() void NWebNativeMediaPlayerBridgeImpl::SuspendMediaPlayer(SuspendType type) { - WVLOG_I("begin to suspend media player, nweb id is %{public}d %{public}d", nwebId_, static_cast(type)); + WVLOG_D("begin to suspend media player, nweb id is %{public}d %{public}d", nwebId_, static_cast(type)); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; @@ -308,6 +322,7 @@ void NWebNativeMediaPlayerBridgeImpl::SuspendMediaPlayer(SuspendType type) if (env->FunctionalObject_Call(static_cast(suspendRef), ani_size(INTEGER_ONE), argv, &ref) != ANI_OK) { WVLOG_E("SuspendMediaPlayer failed"); + return; } } @@ -319,7 +334,14 @@ NWebCreateNativeMediaPlayerCallbackImpl::NWebCreateNativeMediaPlayerCallbackImpl if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; } - env->GlobalReference_Create(static_cast(callback), &callback_); + if (env == nullptr) { + WVLOG_E("env is nulptr"); + return; + } + if (env->GlobalReference_Create(static_cast(callback), &callback_) != ANI_OK) { + WVLOG_E("nwebCreateNativeMediaPlayerCallbackImpl failed"); + return; + } } NWebCreateNativeMediaPlayerCallbackImpl::~NWebCreateNativeMediaPlayerCallbackImpl() @@ -328,13 +350,20 @@ NWebCreateNativeMediaPlayerCallbackImpl::~NWebCreateNativeMediaPlayerCallbackImp if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return; } - env->GlobalReference_Delete(callback_); + if (env == nullptr) { + WVLOG_E("env is nulptr"); + return; + } + if (env->GlobalReference_Delete(callback_) != ANI_OK) { + WVLOG_E("nwebCreateNativeMediaPlayerCallbackImpl failed"); + return; + } } std::shared_ptr NWebCreateNativeMediaPlayerCallbackImpl::OnCreate( std::shared_ptr handler, std::shared_ptr mediaInfo) { - WVLOG_I("begin to create native media player, nweb id is %{public}d", nwebId_); + WVLOG_D("begin to create native media player, nweb id is %{public}d", nwebId_); if (!callback_) { WVLOG_E("callback is null, nweb id is %{public}d", nwebId_); @@ -373,7 +402,7 @@ std::shared_ptr NWebCreateNativeMediaPlayerCallback ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructRect( std::shared_ptr surfaceInfo) { - WVLOG_I("ConstructRect start"); + WVLOG_D("ConstructRect start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -399,7 +428,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructRect( ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructHandler( std::shared_ptr handler) { - WVLOG_I("ConstructHandler start"); + WVLOG_D("ConstructHandler start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -434,7 +463,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructHandler( ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructControls(const std::vector& controls) { - WVLOG_I("ConstructControls start"); + WVLOG_D("ConstructControls start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return nullptr; @@ -466,7 +495,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructControls(const std: ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructHeaders(const std::map& headers) { - WVLOG_I("ConstructHeaders start"); + WVLOG_D("ConstructHeaders start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { @@ -502,7 +531,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructHeaders(const std:: ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructAttributes( const std::map& attributes) { - WVLOG_I("ConstructAttributes start"); + WVLOG_D("ConstructAttributes start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return nullptr; @@ -536,7 +565,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructAttributes( ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructMediaInfo(std::shared_ptr mediaInfo) { - WVLOG_I("ConstructMediaInfo start"); + WVLOG_D("ConstructMediaInfo start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return nullptr; @@ -611,7 +640,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructMediaInfo(std::shar ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructSourceInfos( const std::vector>& sourceInfos) { - WVLOG_I("ConstructSourceInfos start"); + WVLOG_D("ConstructSourceInfos start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return nullptr; @@ -661,7 +690,7 @@ ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructSourceInfos( ani_object NWebCreateNativeMediaPlayerCallbackImpl::ConstructSurfaceInfo( std::shared_ptr surfaceInfo) { - WVLOG_I("ConstructSurfaceInfo start"); + WVLOG_D("ConstructSurfaceInfo start"); ani_env* env = nullptr; if (vm_->GetEnv(ANI_VERSION_1, &env) != ANI_OK) { return nullptr; diff --git a/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.cpp b/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.cpp index 144bacee5..c823fdeb0 100644 --- a/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.cpp +++ b/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.cpp @@ -1004,8 +1004,11 @@ ErrCode WebviewController::HasImagesCallback(ani_vm *vm, ani_ref jsCallback) } auto callbackImpl = std::make_shared(vm, jsCallback, nullptr); - nweb_ptr->HasImages(callbackImpl); - return NWebError::NO_ERROR; + if (callbackImpl) { + nweb_ptr->HasImages(callbackImpl); + return NWebError::NO_ERROR; + } + return NWebError::PARAM_CHECK_ERROR; } ErrCode WebviewController::HasImagesPromise(ani_vm *vm, ani_resolver deferred) @@ -1039,8 +1042,11 @@ ErrCode WebviewController::HasImagesPromise(ani_vm *vm, ani_resolver deferred) } auto callbackImpl = std::make_shared(vm, nullptr, deferred); - nweb_ptr->HasImages(callbackImpl); - return NWebError::NO_ERROR; + if (callbackImpl) { + nweb_ptr->HasImages(callbackImpl); + return NWebError::NO_ERROR; + } + return NWebError::PARAM_CHECK_ERROR; } void WebviewController::RemoveCache(bool includeDiskFiles) @@ -1507,12 +1513,13 @@ void WebviewController::PrecompileJavaScriptPromise( nweb_ptr->PrecompileJavaScript(url, script, cacheOptions, callbackImpl); } -int32_t WebviewController::PrecompileJavaScript(std::string url, std::string script, +int32_t WebviewController::PrecompileJavaScript(const std::string& url, const std::string& script, std::shared_ptr cacheOptions, std::shared_ptr callbackImpl) { WVLOG_D("PrecompDleJavaScript begin"); if (url.empty() || script.empty()) { + WVLOG_E("url or script is empty"); return NWebError::PARAM_CHECK_ERROR; } if (!callbackImpl) { @@ -1522,6 +1529,7 @@ int32_t WebviewController::PrecompileJavaScript(std::string url, std::string scr auto nweb_ptr = NWebHelper::Instance().GetNWeb(nwebId_); if (!nweb_ptr) { + WVLOG_E("nweb_ptr is null"); return NWebError::INIT_ERROR; } nweb_ptr->PrecompileJavaScript(url, script, cacheOptions, callbackImpl); diff --git a/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.h b/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.h index 98773a951..f7b146824 100644 --- a/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.h +++ b/interfaces/kits/ani/webview/native/webviewcontroller/webview_controller.h @@ -326,7 +326,7 @@ public: const std::string &url, const std::string &script, std::shared_ptr cacheOptions); - int32_t PrecompileJavaScript(std::string url, std::string script, + int32_t PrecompileJavaScript(const std::string& url, const std::string& script, std::shared_ptr cacheOptions, std::shared_ptr callbackImpl); diff --git a/interfaces/kits/ani/webview/native/webviewcontroller/webview_hasimage_callback.cpp b/interfaces/kits/ani/webview/native/webviewcontroller/webview_hasimage_callback.cpp index ea95b00df..203cbc16e 100644 --- a/interfaces/kits/ani/webview/native/webviewcontroller/webview_hasimage_callback.cpp +++ b/interfaces/kits/ani/webview/native/webviewcontroller/webview_hasimage_callback.cpp @@ -81,8 +81,7 @@ void WebviewHasImageCallback::OnReceiveValue(bool result) return; } - auto task = [this, result]() { WebviewHasImageCallback::AfterWorkCb(result); }; - task(); + WebviewHasImageCallback::AfterWorkCb(result); vm_->DetachCurrentThread(); } diff --git a/interfaces/kits/ani/webview/src/common/ani_parse_utils.cpp b/interfaces/kits/ani/webview/src/common/ani_parse_utils.cpp index e2600033e..42c03e6b5 100644 --- a/interfaces/kits/ani/webview/src/common/ani_parse_utils.cpp +++ b/interfaces/kits/ani/webview/src/common/ani_parse_utils.cpp @@ -318,7 +318,7 @@ bool AniParseUtils::EnumParseInt32_t(ani_env* env, ani_enum_item enum_item, int3 WVLOG_E("EnumParseInt32 failed - invalid FindClass type"); return false; } - ani_boolean isObject; + ani_boolean isObject = ANI_FALSE; if (env->Object_InstanceOf(static_cast(enum_item), doubleObject, &isObject) != ANI_OK || isObject != ANI_TRUE) { WVLOG_E("EnumParseInt32 failed - invalid int type"); @@ -387,6 +387,7 @@ bool IsFormatStringOfLength(const std::string& str) bool IsNumberOfLength(const std::string& value) { if (value.empty()) { + WVLOG_E("vlaue is empty"); return false; } return std::all_of(value.begin(), value.end(), [](char i) { return isdigit(i); }); @@ -395,6 +396,7 @@ bool IsNumberOfLength(const std::string& value) bool TransStringToInt(const std::string& str, int32_t& value) { if (str.empty()) { + WVLOG_E("str is empty"); return false; } int64_t tempValue = std::stoll(str); @@ -410,9 +412,11 @@ bool TransStringToInt(const std::string& str, int32_t& value) bool AniParseUtils::ParseJsLengthStringToInt(const std::string& input, PixelUnit& type, int32_t& value) { if (input.empty() || input.size() > MAX_STRING_TO_INT32_LENGTH) { + WVLOG_E("invalid input"); return false; } if (!IsFormatStringOfLength(input)) { + WVLOG_E("IsFormatStringOfLength failed"); return false; } if (IsNumberOfLength(input)) { @@ -433,11 +437,13 @@ bool AniParseUtils::ParseJsLengthStringToInt(const std::string& input, PixelUnit return false; } if (input.length() < PARSE_THREE) { + WVLOG_E("input.leng below PARSE_THREE"); return false; } std::string lastTwo = input.substr(input.length() - PARSE_TWO); std::string trans = input.substr(0, input.length() - PARSE_TWO); if (!IsNumberOfLength(trans)) { + WVLOG_E("IsNumberOfLength failed"); return false; } if (lastTwo == "px") { @@ -451,6 +457,7 @@ bool AniParseUtils::ParseJsLengthStringToInt(const std::string& input, PixelUnit return true; } } + WVLOG_E("invaild lastTwo"); return false; } @@ -573,6 +580,10 @@ bool AniParseUtils::CreateBoolean(ani_env *env, bool src, ani_object& aniObj) ani_object AniParseUtils::CreateDouble(ani_env* env, ani_double val) { + if (!env) { + WVLOG_E("env is null"); + return nullptr; + } static constexpr const char* className = "std.core.Double"; ani_class doubleCls {}; env->FindClass(className, &doubleCls); diff --git a/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.cpp b/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.cpp index 1f43e3150..70943ad97 100644 --- a/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.cpp +++ b/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.h b/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.h index bc0098433..2487f79db 100644 --- a/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.h +++ b/interfaces/kits/ani/webview/src/webdatabase/ani_geolocation_permission.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +18,6 @@ #include - namespace OHOS { namespace NWeb { ani_status StsGeolocationPermissionInit(ani_env *env); diff --git a/interfaces/kits/ani/webview/src/webdatabase/ani_web_data_base.cpp b/interfaces/kits/ani/webview/src/webdatabase/ani_web_data_base.cpp index a7c44d51d..22f53cc5d 100644 --- a/interfaces/kits/ani/webview/src/webdatabase/ani_web_data_base.cpp +++ b/interfaces/kits/ani/webview/src/webdatabase/ani_web_data_base.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ +#include "ani_web_data_base.h" #include #include #include #include "ani_business_error.h" #include "ani_parse_utils.h" -#include "ani_web_data_base.h" #include "nweb_helper.h" #include "nweb_log.h" #include "securec.h" @@ -52,6 +52,7 @@ bool GetSize(ani_env* env, ani_string pwd, ani_size& outValue) ani_size bufferSize = 0; env->String_GetUTF8Size(pwd, &bufferSize); if (bufferSize > MAX_PWD_LENGTH) { + WVLOG_E("bufferSize exceed MAX_PWD_LENGTH"); return false; } outValue = bufferSize; diff --git a/interfaces/kits/ani/webview/src/webviewcontroller/ani_native_media_player_handler.cpp b/interfaces/kits/ani/webview/src/webviewcontroller/ani_native_media_player_handler.cpp index f265ebb34..de034898c 100644 --- a/interfaces/kits/ani/webview/src/webviewcontroller/ani_native_media_player_handler.cpp +++ b/interfaces/kits/ani/webview/src/webviewcontroller/ani_native_media_player_handler.cpp @@ -112,9 +112,15 @@ ani_object createObjectDouble(ani_env* env, ani_double status) { static constexpr const char* className = "Lstd/core/Double;"; ani_class doubleCls {}; - env->FindClass(className, &doubleCls); + if (env->FindClass(className, &doubleCls) != ANI_OK) { + WVLOG_E("createObjectDouble failed - invalid FindClass type"); + return nullptr; + } ani_method ctor {}; - env->Class_FindMethod(doubleCls, "", "d:", &ctor); + if (env->Class_FindMethod(doubleCls, "", "d:", &ctor) != ANI_OK) { + WVLOG_E("createObjectDouble findMethod Failed."); + return nullptr; + } ani_object obj {}; if (env->Object_New(doubleCls, ctor, &obj, status) != ANI_OK) { WVLOG_E("createObjectDouble failed"); @@ -127,9 +133,15 @@ ani_object createObjectBoolean(ani_env* env, ani_boolean status) { static constexpr const char* className = "Lstd/core/Boolean;"; ani_class booleanCls {}; - env->FindClass(className, &booleanCls); + if (env->FindClass(className, &booleanCls) != ANI_OK) { + WVLOG_E("createObjectBoolean failed - invalid FindClass type"); + return nullptr; + } ani_method ctor {}; - env->Class_FindMethod(booleanCls, "", "z:", &ctor); + if (env->Class_FindMethod(booleanCls, "", "z:", &ctor) != ANI_OK) { + WVLOG_E("createObjectBoolean findMethod Failed."); + return nullptr; + } ani_object obj {}; if (env->Object_New(booleanCls, ctor, &obj, status) != ANI_OK) { WVLOG_E("createObjectBoolean failed"); @@ -140,7 +152,7 @@ ani_object createObjectBoolean(ani_env* env, ani_boolean status) static void HandleStatusChanged(ani_env* env, ani_object object, ani_enum_item status) { - WVLOG_I("handle_status_changed is called"); + WVLOG_D("handle_status_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -167,13 +179,13 @@ static void HandleStatusChanged(ani_env* env, ani_object object, ani_enum_item s WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_status_changed is called, status is %{public}d", statusStr); + WVLOG_D("handle_status_changed is called, status is %{public}d", statusStr); handler->HandleStatusChanged(static_cast(statusStr)); } static void HandleVolumeChanged(ani_env* env, ani_object object, ani_double volume) { - WVLOG_I("handle_volume_changed is called"); + WVLOG_D("handle_volume_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -201,13 +213,13 @@ static void HandleVolumeChanged(ani_env* env, ani_object object, ani_double volu WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_volume_changed is called, volume is %{public}f", volumeStr); + WVLOG_D("handle_volume_changed is called, volume is %{public}f", volumeStr); handler->HandleVolumeChanged(volumeStr); } static void HandleMutedChanged(ani_env* env, ani_object object, ani_boolean muted) { - WVLOG_I("handle_muted_changed is called"); + WVLOG_D("handle_muted_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -230,13 +242,13 @@ static void HandleMutedChanged(ani_env* env, ani_object object, ani_boolean mute WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_muted_changed is called, muted is %{public}d", mutedStr); + WVLOG_D("handle_muted_changed is called, muted is %{public}d", mutedStr); handler->HandleMutedChanged(mutedStr); } static void HandlePlaybackRateChanged(ani_env* env, ani_object object, ani_double playbackRate) { - WVLOG_I("handle_playback_rate_changed is called"); + WVLOG_D("handle_playback_rate_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -264,13 +276,13 @@ static void HandlePlaybackRateChanged(ani_env* env, ani_object object, ani_doubl WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_playback_rate_changed is called, playbackRate is %{public}f", playbackRateStr); + WVLOG_D("handle_playback_rate_changed is called, playbackRate is %{public}f", playbackRateStr); handler->HandlePlaybackRateChanged(playbackRateStr); } static void HandleDurationChanged(ani_env* env, ani_object object, ani_double duration) { - WVLOG_I("handle_duration_changed is called"); + WVLOG_D("handle_duration_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -298,13 +310,13 @@ static void HandleDurationChanged(ani_env* env, ani_object object, ani_double du WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_duration_changed is called, duration is %{public}f", durationStr); + WVLOG_D("handle_duration_changed is called, duration is %{public}f", durationStr); handler->HandleDurationChanged(durationStr); } static void HandleTimeUpdate(ani_env* env, ani_object object, ani_double currentPlayTime) { - WVLOG_I("handle_time_update is called"); + WVLOG_D("handle_time_update is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -332,13 +344,13 @@ static void HandleTimeUpdate(ani_env* env, ani_object object, ani_double current WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_time_update is called, currentPlayTime is %{public}f", currentPlayTimeStr); + WVLOG_D("handle_time_update is called, currentPlayTime is %{public}f", currentPlayTimeStr); handler->HandleTimeUpdate(currentPlayTimeStr); } static void HandleBufferedEndTimeChanged(ani_env* env, ani_object object, ani_double bufferedEndTime) { - WVLOG_I("handle_buffered_end_time_changed is called"); + WVLOG_D("handle_buffered_end_time_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -366,13 +378,13 @@ static void HandleBufferedEndTimeChanged(ani_env* env, ani_object object, ani_do WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_buffered_end_time_changed is called, bufferedEndTime is %{public}f", bufferedEndTimeStr); + WVLOG_D("handle_buffered_end_time_changed is called, bufferedEndTime is %{public}f", bufferedEndTimeStr); handler->HandleBufferedEndTimeChanged(bufferedEndTimeStr); } static void HandleEnded(ani_env* env, ani_object object) { - WVLOG_I("handle_ended is called"); + WVLOG_D("handle_ended is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -389,7 +401,7 @@ static void HandleEnded(ani_env* env, ani_object object) static void HandleNetworkStateChanged(ani_env* env, ani_object object, ani_enum_item state) { - WVLOG_I("handle_network_state_changed is called"); + WVLOG_D("handle_network_state_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -413,13 +425,13 @@ static void HandleNetworkStateChanged(ani_env* env, ani_object object, ani_enum_ WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_network_state_changed is called, state is %{public}d", stateStr); + WVLOG_D("handle_network_state_changed is called, state is %{public}d", stateStr); handler->HandleNetworkStateChanged(static_cast(stateStr)); } static void HandleReadyStateChanged(ani_env* env, ani_object object, ani_enum_item state) { - WVLOG_I("handle_ready_state_changed is called"); + WVLOG_D("handle_ready_state_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -443,13 +455,13 @@ static void HandleReadyStateChanged(ani_env* env, ani_object object, ani_enum_it WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_ready_state_changed is called, state is %{public}d", stateStr); + WVLOG_D("handle_ready_state_changed is called, state is %{public}d", stateStr); handler->HandleReadyStateChanged(static_cast(stateStr)); } static void HandleFullScreenChanged(ani_env* env, ani_object object, ani_boolean fullscreen) { - WVLOG_I("handle_full_screen_changed is called"); + WVLOG_D("handle_full_screen_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -472,13 +484,13 @@ static void HandleFullScreenChanged(ani_env* env, ani_object object, ani_boolean WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_full_screen_changed is called, fullscreen is %{public}d", fullscreenStr); + WVLOG_D("handle_full_screen_changed is called, fullscreen is %{public}d", fullscreenStr); handler->HandleFullScreenChanged(fullscreenStr); } static void HandleSeeking(ani_env* env, ani_object object) { - WVLOG_I("handle_seeking is called"); + WVLOG_D("handle_seeking is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -495,7 +507,7 @@ static void HandleSeeking(ani_env* env, ani_object object) static void HandleSeekFinished(ani_env* env, ani_object object) { - WVLOG_I("handle_seek_finished is called"); + WVLOG_D("handle_seek_finished is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -512,7 +524,7 @@ static void HandleSeekFinished(ani_env* env, ani_object object) static void HandleError(ani_env* env, ani_object object, ani_enum_item error, ani_string errorMessage) { - WVLOG_I("handle_error is called"); + WVLOG_D("handle_error is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -543,14 +555,14 @@ static void HandleError(ani_env* env, ani_object object, ani_enum_item error, an WVLOG_E("native media player handler is null"); return; } - WVLOG_I( + WVLOG_D( "handle_error is called, error is %{public}d, errorMessage is %{public}s", errorStr, errorMessageStr.c_str()); handler->HandleError(static_cast(errorStr), errorMessageStr); } static void HandleVideoSizeChanged(ani_env* env, ani_object object, ani_double width, ani_double height) { - WVLOG_I("handle_video_size_changed is called"); + WVLOG_D("handle_video_size_changed is called"); if (env == nullptr) { WVLOG_E("env is nullptr"); @@ -584,7 +596,7 @@ static void HandleVideoSizeChanged(ani_env* env, ani_object object, ani_double w WVLOG_E("native media player handler is null"); return; } - WVLOG_I("handle_video_size_changed is called, width is %{public}f, height is %{public}f", + WVLOG_D("handle_video_size_changed is called, width is %{public}f, height is %{public}f", widthStr, heightStr); handler->HandleVideoSizeChanged(widthStr, heightStr); } diff --git a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_controller.cpp b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_controller.cpp index 802a71cf3..9033f11a9 100644 --- a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_controller.cpp +++ b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_controller.cpp @@ -119,20 +119,20 @@ struct SnapshotOptions { bool ParsePrepareUrl(ani_env* env, ani_ref urlObj, std::string& url) { if (AniParseUtils::ParseString(env, urlObj, url)) { - if (url.size() > URL_MAXIMUM) { - WVLOG_E("The URL exceeds the maximum length of %{public}d", URL_MAXIMUM); - return false; - } + WVLOG_E("urlObj convert to string failed"); + return false; + } - if (!regex_match(url, std::regex(URL_REGEXPR, std::regex_constants::icase))) { - WVLOG_E("ParsePrepareUrl error"); - return false; - } - return true; + if (url.size() > URL_MAXIMUM) { + WVLOG_E("The URL exceeds the maximum length of %{public}d", URL_MAXIMUM); + return false; } - WVLOG_E("Unable to parse type from url object."); - return false; + if (!regex_match(url, std::regex(URL_REGEXPR, std::regex_constants::icase))) { + WVLOG_E("ParsePrepareUrl error"); + return false; + } + return true; } bool ParsePrepareRequestMethod(ani_env* env, ani_ref methodObj, std::string& method) @@ -2796,7 +2796,10 @@ static ani_string GetSurfaceId(ani_env* env, ani_object object) return result; } std::string surfaceId = controller->GetSurfaceId(); - env->String_NewUTF8(surfaceId.c_str(), surfaceId.size(), &result); + if (env->String_NewUTF8(surfaceId.c_str(), surfaceId.size(), &result) != ANI_OK) { + WVLOG_E("create ani_string failed"); + return result; + } return result; } @@ -3070,7 +3073,6 @@ static void PrefetchResource(ani_env* env, ani_object object, ani_object request return; } NWebHelper::Instance().PrefetchResource(prefetchArgs, additionalHttpHeadersObj, cacheKeyObj, cacheValidTimeObj); - return; } static void StartCamera(ani_env* env, ani_object object) @@ -3090,7 +3092,6 @@ static void StartCamera(ani_env* env, ani_object object) AniBusinessError::ThrowErrorByErrCode(env, ret); return; } - return; } static void CloseAllMediaPresentations(ani_env* env, ani_object object) @@ -3106,7 +3107,6 @@ static void CloseAllMediaPresentations(ani_env* env, ani_object object) return; } controller->CloseAllMediaPresentations(); - return; } static void StopAllMedia(ani_env* env, ani_object object) @@ -3122,7 +3122,6 @@ static void StopAllMedia(ani_env* env, ani_object object) return; } controller->StopAllMedia(); - return; } static void StopCamera(ani_env* env, ani_object object) @@ -3142,7 +3141,6 @@ static void StopCamera(ani_env* env, ani_object object) AniBusinessError::ThrowErrorByErrCode(env, ret); return; } - return; } static void CloseCamera(ani_env* env, ani_object object) @@ -3162,7 +3160,6 @@ static void CloseCamera(ani_env* env, ani_object object) AniBusinessError::ThrowErrorByErrCode(env, ret); return; } - return; } static void PauseAllMedia(ani_env* env, ani_object object) @@ -3178,7 +3175,6 @@ static void PauseAllMedia(ani_env* env, ani_object object) return; } controller->PauseAllMedia(); - return; } static void ResumeAllMedia(ani_env* env, ani_object object) @@ -3194,7 +3190,6 @@ static void ResumeAllMedia(ani_env* env, ani_object object) return; } controller->ResumeAllMedia(); - return; } static void SetAudioMuted(ani_env* env, ani_object object,ani_boolean mute) @@ -3214,7 +3209,6 @@ static void SetAudioMuted(ani_env* env, ani_object object,ani_boolean mute) AniBusinessError::ThrowErrorByErrCode(env, ret); return; } - return; } static ani_enum_item GetMediaPlaybackState(ani_env* env, ani_object object) @@ -3226,7 +3220,10 @@ static ani_enum_item GetMediaPlaybackState(ani_env* env, ani_object object) } ani_int mediaPlaybackState = 0; ani_enum enumType; - env->FindEnum(ANI_ENUM_MEDIA_PLAY_BACK_STATE, &enumType); + if ((env->FindEnum(ANI_ENUM_MEDIA_PLAY_BACK_STATE, &enumType)) != ANI_OK) { + WVLOG_E("findEnum is error"); + return nullptr; + } auto* controller = reinterpret_cast(AniParseUtils::Unwrap(env, object)); if (!controller || !controller->IsInit()) { AniBusinessError::ThrowErrorByErrCode(env, INIT_ERROR); @@ -3234,7 +3231,10 @@ static ani_enum_item GetMediaPlaybackState(ani_env* env, ani_object object) } mediaPlaybackState = static_cast(controller->GetMediaPlaybackState()); ani_enum_item state; - env->Enum_GetEnumItemByIndex(enumType, mediaPlaybackState, &state); + if ((env->Enum_GetEnumItemByIndex(enumType, mediaPlaybackState, &state)) != ANI_OK) { + WVLOG_E("getEnum is error"); + return nullptr; + } return state; } @@ -3246,7 +3246,10 @@ void OnCreateNativeMediaPlayer(ani_env* env, ani_object object, ani_fn_object ca } ani_vm *vm = nullptr; - env->GetVM(&vm); + if (env->GetVM(&vm) != ANI_OK) { + WVLOG_E("Failed to get VM from env"); + return; + } g_vm = vm; WVLOG_D("put on_create_native_media_player callback"); @@ -3282,6 +3285,7 @@ bool ParseJsLengthResourceToInt(ani_env* env, ani_object jsLength, PixelUnit& ty } ani_double resIdDouble; if ((env->Object_GetPropertyByName_Double(jsLength, "id", &resIdDouble) != ANI_OK)) { + WVLOG_E("Object_GetPropertyByName_Double failed"); return false; } int32_t resId = static_cast(resIdDouble); @@ -3366,7 +3370,9 @@ static void JsErrorCallback(ani_env* env, ani_ref jsCallback, int32_t err) vec.push_back(jsError); vec.push_back(jsResult); ani_ref fnReturnVal; - env->FunctionalObject_Call(callbackFn, ani_size(RESULT_COUNT), vec.data(), &fnReturnVal); + if (env->FunctionalObject_Call(callbackFn, ani_size(RESULT_COUNT), vec.data(), &fnReturnVal) != ANI_OK) { + WVLOG_E("FunctionalObject_Call failed"); + } } bool CreateSizeObject(ani_env* env, const char* className, ani_object& object, ani_int size) @@ -3421,7 +3427,10 @@ WebSnapshotCallback CreateWebPageSnapshotResultCallback( } else { WVLOG_E("WebPageSnapshot create pixel map error"); } - env->Object_SetPropertyByName_Ref(jsResult, "imagePixelMap", jsPixelMap); + if (env->Object_SetPropertyByName_Ref(jsResult, "imagePixelMap", jsPixelMap) != ANI_OK) { + WVLOG_E("Object_SetPropertyByName_Ref failed"); + return; + } int returnJsWidth = 0; int returnJsHeight = 0; if (radio > 0) { @@ -3466,10 +3475,14 @@ WebSnapshotCallback CreateWebPageSnapshotResultCallback( return; } ani_string jsId = nullptr; - env->String_NewUTF8(returnId, strlen(returnId), &jsId); + if (env->String_NewUTF8(returnId, strlen(returnId), &jsId) != ANI_OK) { + WVLOG_E("String_NewUTF8 failed"); + return; + } env->Object_SetPropertyByName_Ref(jsResult, "id", jsId); ani_object jsStatus = {}; if (!AniParseUtils::CreateBoolean(env, returnStatus, jsStatus)) { + WVLOG_E("CreateBoolean failed"); return; } env->Object_SetPropertyByName_Ref(jsResult, "status", jsStatus); @@ -3479,8 +3492,14 @@ WebSnapshotCallback CreateWebPageSnapshotResultCallback( vec.push_back(jsError); vec.push_back(jsResult); ani_fn_object callbackFn = static_cast(jCallback); - env->FunctionalObject_Call(callbackFn, ani_size(RESULT_COUNT), vec.data(), &callbackResult); - env->GlobalReference_Delete(jCallback); + if (env->FunctionalObject_Call(callbackFn, ani_size(RESULT_COUNT), vec.data(), &callbackResult) != ANI_OK) { + WVLOG_E("execute callFunction failed"); + return; + } + if (env->GlobalReference_Delete(jCallback) != ANI_OK) { + WVLOG_E("delete global Ref failed"); + return; + } g_inWebPageSnapshot = false; }; } @@ -3496,7 +3515,10 @@ bool ParseSnapshotOptions(ani_env* env, ani_object info, SnapshotOptions& option ani_ref snapshotSizeWidth = nullptr; ani_ref snapshotSizeHeight = nullptr; if (env->Object_GetPropertyByName_Ref(info, "id", &snapshotId) == ANI_OK) { - AniParseUtils::ParseString(env, snapshotId, options.id); + if (!AniParseUtils::ParseString(env, snapshotId, options.id)) { + WVLOG_E("ParseString failed"); + return false; + } } if (env->Object_GetPropertyByName_Ref(info, "size", &snapshotSize) == ANI_OK) { ani_object snapshotSizeObj = static_cast(snapshotSize); @@ -3537,6 +3559,7 @@ static void WebPageSnapshot(ani_env* env, ani_object object, ani_object info, an return; } if (!AniParseUtils::IsFunction(env, callback)) { + WVLOG_E("callback is not function"); return; } auto* controller = reinterpret_cast(AniParseUtils::Unwrap(env, object)); @@ -3551,6 +3574,7 @@ static void WebPageSnapshot(ani_env* env, ani_object object, ani_object info, an g_inWebPageSnapshot = true; SnapshotOptions options; if (!ParseSnapshotOptions(env, info, options)) { + WVLOG_E("ParseSnapshotOptions failed"); JsErrorCallback(env, std::move(callback), PARAM_CHECK_ERROR); g_inWebPageSnapshot = false; return; @@ -4790,7 +4814,7 @@ WebPrintWriteResultCallback ParseWebPrintWriteResultCallback(ani_env* env, ani_o return nullptr; } - ani_ref callbackRef; + ani_ref callbackRef = nullptr; if (env->GlobalReference_Create(static_cast(callback), &callbackRef) != ANI_OK) { WVLOG_E("failed to create reference for callback"); @@ -4803,7 +4827,7 @@ WebPrintWriteResultCallback ParseWebPrintWriteResultCallback(ani_env* env, ani_o if (env->String_NewUTF8(jobId.c_str(), jobId.size(), &jobIdString) == ANI_OK) { argv.push_back(static_cast(jobIdString)); } - ani_enum_item stateEnum; + ani_enum_item stateEnum = nullptr; if (AniParseUtils::GetEnumItemByIndex( env, "L@ohos/print/print/PrintFileCreationState;", static_cast(state), stateEnum)) { argv.push_back(static_cast(stateEnum)); @@ -4851,7 +4875,7 @@ static void ParsePrintRangeAdapter(ani_env* env, ani_object pageRange, PrintAttr ani_size length = 0; env->Array_GetLength(pagesArrayInt, &length); for (uint32_t i = 0; i < length; ++i) { - ani_int pagesInt; + ani_int pagesInt = 0; env->Array_GetRegion_Int(pagesArrayInt, i, 1, &pagesInt); int pagesNum = static_cast(pagesInt); printAttr.pageRange.pages.push_back(pagesNum); @@ -5071,7 +5095,10 @@ static void HasImageCallback(ani_env* env, ani_object object, ani_fn_object call return; } ani_vm* vm = nullptr; - env->GetVM(&vm); + if (env->GetVM(&vm) != ANI_OK) { + WVLOG_E("Failed to get VM from env"); + return; + } if (!vm) { WVLOG_E("vm is nullptr"); return; @@ -5110,7 +5137,10 @@ ani_object HasImagePromise(ani_env* env, ani_object object) return nullptr; } ani_vm* vm = nullptr; - env->GetVM(&vm); + if (env->GetVM(&vm) != ANI_OK) { + WVLOG_E("Failed to get VM from env"); + return nullptr; + } if (!vm) { WVLOG_E("vm is nullptr"); return nullptr; diff --git a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.cpp b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.cpp index 4e3281de5..acaaa80f3 100644 --- a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.cpp +++ b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2024 Huawei Device Co., Ltd. +* Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.h b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.h index a7c229758..c019e77b4 100644 --- a/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.h +++ b/interfaces/kits/ani/webview/src/webviewcontroller/ani_webview_createpdf_execute_callback.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2024 Huawei Device Co., Ltd. +* Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee