From 40cedcb34cea29ab1797fe532ab72125ee8fa8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E5=AE=87=E6=88=90?= Date: Wed, 16 Oct 2024 16:58:04 +0800 Subject: [PATCH] upload dmp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 庞宇成 --- ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc | 8 ++++++++ ohos_nweb/src/nweb_impl.cc | 13 +++++++++++++ ohos_nweb/src/nweb_impl.h | 5 ++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc b/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc index 2fd9aad0c8..528175a568 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 0cf92c09bf..ae89b798ab 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 a5f0baf021..790edf867e 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 -- Gitee