From 6a9cada98c7ab6ac88b3f64662ba1bfa6dded608 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Fri, 6 Aug 2021 14:04:19 -0700 Subject: [PATCH] fix: build SetCrashKeyGW without tray on Windows (#30437) --- shell/common/crash_keys.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shell/common/crash_keys.cc b/shell/common/crash_keys.cc index 73e0f6552b4f..43bd981d52c6 100644 --- a/shell/common/crash_keys.cc +++ b/shell/common/crash_keys.cc @@ -41,13 +41,15 @@ #include "shell/browser/api/electron_api_service_worker_context.h" #include "shell/browser/api/electron_api_session.h" #include "shell/browser/api/electron_api_system_preferences.h" -#include "shell/browser/api/electron_api_tray.h" #include "shell/browser/api/electron_api_url_loader.h" #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/api/electron_api_web_frame_main.h" #include "shell/browser/api/electron_api_web_request.h" #include "shell/browser/api/event.h" #include "shell/common/api/electron_api_native_image.h" +#if !defined(OS_WIN) +#include "shell/browser/api/electron_api_tray.h" +#endif namespace electron { @@ -205,6 +207,10 @@ void SetCrashKeyForGinWrappable(gin::WrapperInfo* info) { else if (info == &electron::api::DesktopCapturer::kWrapperInfo) crash_location = "DesktopCapturer"; #endif +#if !defined(OS_WIN) + else if (info == &electron::api::Tray::kWrapperInfo) + crash_location = "Tray"; +#endif // OS_WIN else if (info == &electron::api::NetLog::kWrapperInfo) crash_location = "NetLog"; else if (info == &electron::api::NativeImage::kWrapperInfo) @@ -235,8 +241,6 @@ void SetCrashKeyForGinWrappable(gin::WrapperInfo* info) { crash_location = "GlobalShortcut"; else if (info == &electron::api::InAppPurchase::kWrapperInfo) crash_location = "InAppPurchase"; - else if (info == &electron::api::Tray::kWrapperInfo) - crash_location = "Tray"; else if (info == &electron::api::DataPipeHolder::kWrapperInfo) crash_location = "DataPipeHolder"; else if (info == &electron::api::AutoUpdater::kWrapperInfo)