diff --git a/shell/browser/api/electron_api_menu.cc b/shell/browser/api/electron_api_menu.cc index 2630463d486..787722f45e3 100644 --- a/shell/browser/api/electron_api_menu.cc +++ b/shell/browser/api/electron_api_menu.cc @@ -236,7 +236,7 @@ std::u16string Menu::GetToolTipAt(int index) const { return model_->GetToolTipAt(index); } -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() std::u16string Menu::GetAcceleratorTextAtForTesting(int index) const { ui::Accelerator accelerator; model_->GetAcceleratorAtWithParams(index, true, &accelerator); @@ -297,7 +297,7 @@ v8::Local Menu::FillObjectTemplate( .SetMethod("isVisibleAt", &Menu::IsVisibleAt) .SetMethod("popupAt", &Menu::PopupAt) .SetMethod("closePopupAt", &Menu::ClosePopupAt) -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() .SetMethod("getAcceleratorTextAt", &Menu::GetAcceleratorTextAtForTesting) #endif .Build(); diff --git a/shell/browser/api/electron_api_menu.h b/shell/browser/api/electron_api_menu.h index 3fd2be0c300..1efdad158cd 100644 --- a/shell/browser/api/electron_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -78,7 +78,7 @@ class Menu : public gin::Wrappable, int positioning_item, base::OnceClosure callback) = 0; virtual void ClosePopupAt(int32_t window_id) = 0; -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() virtual std::u16string GetAcceleratorTextAtForTesting(int index) const; #endif diff --git a/shell/browser/api/electron_api_menu_mac.h b/shell/browser/api/electron_api_menu_mac.h index c94df8fc74b..4c2ae0018f2 100644 --- a/shell/browser/api/electron_api_menu_mac.h +++ b/shell/browser/api/electron_api_menu_mac.h @@ -34,7 +34,7 @@ class MenuMac : public Menu { int positioning_item, base::OnceClosure callback); void ClosePopupAt(int32_t window_id) override; -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() std::u16string GetAcceleratorTextAtForTesting(int index) const override; #endif diff --git a/shell/browser/api/electron_api_menu_mac.mm b/shell/browser/api/electron_api_menu_mac.mm index 0d3d5eff41e..ab34ff79950 100644 --- a/shell/browser/api/electron_api_menu_mac.mm +++ b/shell/browser/api/electron_api_menu_mac.mm @@ -127,7 +127,7 @@ void MenuMac::ClosePopupAt(int32_t window_id) { std::move(close_popup)); } -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() std::u16string MenuMac::GetAcceleratorTextAtForTesting(int index) const { // A least effort to get the real shortcut text of NSMenuItem, the code does // not need to be perfect since it is test only. diff --git a/shell/common/api/electron_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc index 8d1bceb904f..68a23e7f17f 100644 --- a/shell/common/api/electron_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -106,7 +106,7 @@ bool IsSameOrigin(const GURL& l, const GURL& r) { return url::Origin::Create(l).IsSameOriginWith(url::Origin::Create(r)); } -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() std::vector> weakly_tracked_values; void WeaklyTrackValue(v8::Isolate* isolate, v8::Local value) { @@ -156,7 +156,7 @@ void Initialize(v8::Local exports, dict.SetMethod("requestGarbageCollectionForTesting", &RequestGarbageCollectionForTesting); dict.SetMethod("isSameOrigin", &IsSameOrigin); -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() dict.SetMethod("triggerFatalErrorForTesting", &TriggerFatalErrorForTesting); dict.SetMethod("getWeaklyTrackedValues", &GetWeaklyTrackedValues); dict.SetMethod("clearWeaklyTrackedValues", &ClearWeaklyTrackedValues); diff --git a/shell/renderer/api/electron_api_context_bridge.cc b/shell/renderer/api/electron_api_context_bridge.cc index 342aeca3963..b072e3cb017 100644 --- a/shell/renderer/api/electron_api_context_bridge.cc +++ b/shell/renderer/api/electron_api_context_bridge.cc @@ -723,7 +723,7 @@ void Initialize(v8::Local exports, &electron::api::OverrideGlobalPropertyFromIsolatedWorld); dict.SetMethod("_isCalledFromMainWorld", &electron::api::IsCalledFromMainWorld); -#ifdef DCHECK_IS_ON +#if DCHECK_IS_ON() dict.Set("_isDebug", true); #endif }