diff --git a/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc b/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc index 2fd9aad0c86e727cbe7ccc7d246d9652a1c796dc..528175a568a2ccd63b4536323d3ab400e3ec769f 100644 --- a/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc +++ b/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc @@ -93,6 +93,9 @@ #ifdef OHOS_ARKWEB_ADBLOCK #include "base/strings/string_number_conversions.h" #endif +#if defined(OHOS_NWEB_EX) && defined(OHOS_CRASHPAD) +#include "ohos_nweb_ex/overrides/ohos_nweb/src/cef_delegate/custom_crashpad_handler.h" +#endif namespace OHOS::NWeb { namespace { @@ -1539,6 +1542,11 @@ void NWebHandlerDelegate::OnRenderProcessTerminated( ReportPageLoadErrorInfo(nweb_id_, error_type, static_cast(reason), error_desc); #endif + +#if defined(OHOS_NWEB_EX) && defined(OHOS_CRASHPAD) + OHOS::NWeb::ReportFeedbacklogsCrashDmpFiles( + NWebImpl::GetDefaultFeedbacklogsCrashPath()); +#endif } bool NWebHandlerDelegate::GetAuthCredentials( diff --git a/ohos_nweb/src/nweb_impl.cc b/ohos_nweb/src/nweb_impl.cc index 0cf92c09bf1bf9684162d9c6d8de4e2298a9ab61..ae89b798ab3b04367b1ad8ac2cbd125d68811a75 100644 --- a/ohos_nweb/src/nweb_impl.cc +++ b/ohos_nweb/src/nweb_impl.cc @@ -189,6 +189,8 @@ static bool enable_whole_web_page_drawing = false; #if defined(OHOS_CRASHPAD) static std::string g_crashpad_target_location = "/data/storage/el2/crashpad"; +static std::string g_feedbacklogs_crash_path = + "/data/storage/el2/base/haps/entry/files/logs/logs/logFile"; #endif bool GetWebOptimizationValue() { @@ -2770,6 +2772,17 @@ void NWebImpl::SetDefaultCrashpadLogPath(const std::string& crashpad_log_path) { const std::string NWebImpl::GetDefaultCrashpadLogPath() { return g_crashpad_target_location; } + +void NWebImpl::SetDefaultFeedbacklogsCrashPath( + const std::string& feedbacklogs_crash_path) { + LOG(INFO) << "[feedbacklogs] g_feedbacklogs_crash_path: " << g_feedbacklogs_crash_path + << ", feedbacklogs_crash_path: " << feedbacklogs_crash_path; + g_feedbacklogs_crash_path = feedbacklogs_crash_path; +} + +const std::string& NWebImpl::GetDefaultFeedbacklogsCrashPath() { + return g_feedbacklogs_crash_path; +} #endif bool NWebImpl::Discard() { diff --git a/ohos_nweb/src/nweb_impl.h b/ohos_nweb/src/nweb_impl.h index a5f0baf021c9d611e4d868dbf007097d19bdf61a..790edf867e23d61ecb73e0a5026fcc3d379c4ad5 100644 --- a/ohos_nweb/src/nweb_impl.h +++ b/ohos_nweb/src/nweb_impl.h @@ -476,6 +476,9 @@ class NWebImpl : public NWeb { #ifdef OHOS_CRASHPAD static void SetDefaultCrashpadLogPath(const std::string& crashpad_log_path); static const std::string GetDefaultCrashpadLogPath(); + static void SetDefaultFeedbacklogsCrashPath( + const std::string& feedbacklogs_crash_path); + static const std::string& GetDefaultFeedbacklogsCrashPath(); #endif #if defined(OHOS_INCOGNITO_MODE) @@ -541,7 +544,7 @@ class NWebImpl : public NWeb { #ifdef OHOS_NETWORK_LOAD void SetPathAllowingUniversalAccess( - const std::vector& pathList, + const std::vector& pathList, const std::vector& moduleName, std::string& errorPath) override; #endif