From c99e3480ac6ecec6c5e75bf0d26dff5acf3abacd Mon Sep 17 00:00:00 2001 From: Hao <131711973+haozheng-cobalt@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:46:26 -0800 Subject: [PATCH] Use SB_DCHECK in Starboard (#4677) We should use SB_DCHECK in Starboard This is to address error: ../../starboard/android/shared/starboard_bridge.cc -o obj/starboard/android/shared/starboard_platform/starboard_bridge.o 2025-01-08T23:34:08.9074020Z ../../starboard/android/shared/starboard_bridge.cc:112:3: error: no member named 'CheckFailure' in namespace 'starboard::logging'; did you mean '::logging::CheckFailure'? 2025-01-08T23:34:08.9075172Z CHECK(env); 2025-01-08T23:34:08.9075476Z ^~~~~~~~~~ 2025-01-08T23:34:08.9075894Z ../../base/check.h:165:28: note: expanded from macro 'CHECK' 2025-01-08T23:34:08.9076719Z UNLIKELY(!(condition)) ? logging::CheckFailure() : EAT_CHECK_STREAM_PARAMS() 2025-01-08T23:34:08.9077341Z ^~~~~~~~~ 2025-01-08T23:34:08.9077899Z ../../base/check.h:155:49: note: '::logging::CheckFailure' declared here 2025-01-08T23:34:08.9078574Z [[noreturn]] IMMEDIATE_CRASH_ALWAYS_INLINE void CheckFailure() { b/372559388 --- starboard/android/shared/starboard_bridge.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/starboard/android/shared/starboard_bridge.cc b/starboard/android/shared/starboard_bridge.cc index 8a9ae6d1b2608..404d84c2aff56 100644 --- a/starboard/android/shared/starboard_bridge.cc +++ b/starboard/android/shared/starboard_bridge.cc @@ -17,6 +17,7 @@ #include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "starboard/android/shared/file_internal.h" +#include "starboard/common/log.h" #include "starboard/common/time.h" #include "starboard/media.h" #include "starboard/shared/starboard/audio_sink/audio_sink_internal.h" @@ -52,28 +53,28 @@ void StarboardBridge::Initialize(JNIEnv* env, jobject obj) { } long StarboardBridge::GetAppStartTimestamp(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); return Java_StarboardBridge_getAppStartTimestamp(env, j_starboard_bridge_); } void StarboardBridge::ApplicationStarted(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); Java_StarboardBridge_applicationStarted(env, j_starboard_bridge_); } void StarboardBridge::ApplicationStopping(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); Java_StarboardBridge_applicationStopping(env, j_starboard_bridge_); } void StarboardBridge::AfterStopped(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); Java_StarboardBridge_afterStopped(env, j_starboard_bridge_); } void StarboardBridge::AppendArgs(JNIEnv* env, std::vector* args_vector) { - CHECK(env); + SB_DCHECK(env); base::android::ScopedJavaLocalRef args_java = Java_StarboardBridge_getArgs(env, j_starboard_bridge_); base::android::AppendJavaStringArrayToStringVector(env, args_java, @@ -81,7 +82,7 @@ void StarboardBridge::AppendArgs(JNIEnv* env, } std::string StarboardBridge::GetStartDeepLink(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); base::android::ScopedJavaLocalRef start_deep_link_java = Java_StarboardBridge_getStartDeepLink(env, j_starboard_bridge_); std::string start_deep_link = @@ -91,7 +92,7 @@ std::string StarboardBridge::GetStartDeepLink(JNIEnv* env) { base::android::ScopedJavaLocalRef StarboardBridge::GetSupportedHdrTypes(JNIEnv* env) { - CHECK(env); + SB_DCHECK(env); return Java_StarboardBridge_getSupportedHdrTypes(env, j_starboard_bridge_); } } // namespace shared