Open Bug 1818667 Opened 2 years ago Updated 1 year ago

exceptionMode = nsresult should handle more exceptions such as OOM

Categories

(GeckoView :: General, enhancement, P3)

All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: m_kato, Unassigned)

Details

https://searchfox.org/mozilla-central/rev/edccfac5746704da49c1551aed8b79f57003bd68/widget/android/jni/Accessors.h#43

// Base class for Method<>, Field<>, and Constructor<>.
class Accessor {
  static void GetNsresult(JNIEnv* env, nsresult* rv) {
    if (env->ExceptionCheck()) {
#ifdef MOZ_CHECK_JNI
      env->ExceptionDescribe();
#endif
      env->ExceptionClear();
      *rv = NS_ERROR_FAILURE;
    } else {
      *rv = NS_OK;
    }
  }

It means that JNI method that has @WrapForJNI(exceptionMode = "nsresult") return NS_ERROR_FAILURE or NS_OK. At least, we should handle OOM too since we already have IsOOMException(JNIEnv* aEnv).

Summary: exceptionMode = nsresult should handles more exceptions → exceptionMode = nsresult should handle more exceptions
Summary: exceptionMode = nsresult should handle more exceptions → exceptionMode = nsresult should handle more exceptions such as OOM
Priority: -- → P3
Component: Core → General
Severity: -- → N/A
You need to log in before you can comment on or make changes to this bug.