Skip to content

Commit

Permalink
Use SB_DCHECK in Starboard (#4677)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
haozheng-cobalt authored Jan 9, 2025
1 parent 148c54e commit c99e348
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions starboard/android/shared/starboard_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -52,36 +53,36 @@ 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<std::string>* args_vector) {
CHECK(env);
SB_DCHECK(env);
base::android::ScopedJavaLocalRef<jobjectArray> args_java =
Java_StarboardBridge_getArgs(env, j_starboard_bridge_);
base::android::AppendJavaStringArrayToStringVector(env, args_java,
args_vector);
}

std::string StarboardBridge::GetStartDeepLink(JNIEnv* env) {
CHECK(env);
SB_DCHECK(env);
base::android::ScopedJavaLocalRef<jstring> start_deep_link_java =
Java_StarboardBridge_getStartDeepLink(env, j_starboard_bridge_);
std::string start_deep_link =
Expand All @@ -91,7 +92,7 @@ std::string StarboardBridge::GetStartDeepLink(JNIEnv* env) {

base::android::ScopedJavaLocalRef<jintArray>
StarboardBridge::GetSupportedHdrTypes(JNIEnv* env) {
CHECK(env);
SB_DCHECK(env);
return Java_StarboardBridge_getSupportedHdrTypes(env, j_starboard_bridge_);
}
} // namespace shared
Expand Down

0 comments on commit c99e348

Please sign in to comment.