Bug 1636285: Add a descriptive message to EnsureJNIObject; r=geckoview-reviewers,droeh
authorAaron Klotz <aklotz@mozilla.com>
Thu, 07 May 2020 22:18:48 +0000
changeset 528710 8acd05d1233734b4e42339ed4dddcf3f989e7883
parent 528709 be3aa8f30db0246ecee9ba1ed146a5969e8fbd3d
child 528711 d543b6ceacd49b099d4b80014e59592109a979da
push id37393
push userrmaries@mozilla.com
push dateFri, 08 May 2020 03:38:07 +0000
treeherdermozilla-central@ead8f0367372 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, droeh
bugs1636285
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1636285: Add a descriptive message to EnsureJNIObject; r=geckoview-reviewers,droeh Differential Revision: https://phabricator.services.mozilla.com/D74328
widget/android/jni/Utils.cpp
--- a/widget/android/jni/Utils.cpp
+++ b/widget/android/jni/Utils.cpp
@@ -249,17 +249,18 @@ bool EnsureJNIObject(JNIEnv* env, jobjec
     sJNIObjectClass =
         Class::GlobalRef(Class::LocalRef::Adopt(GetClassRef(
                              env, "org/mozilla/gecko/mozglue/JNIObject")))
             .Forget();
 
     sJNIObjectHandleField = env->GetFieldID(sJNIObjectClass, "mHandle", "J");
   }
 
-  MOZ_ASSERT(env->IsInstanceOf(instance, sJNIObjectClass));
+  MOZ_ASSERT(env->IsInstanceOf(instance, sJNIObjectClass),
+             "Java class is not derived from JNIObject");
   return true;
 }
 
 }  // namespace
 
 uintptr_t GetNativeHandle(JNIEnv* env, jobject instance) {
   if (!EnsureJNIObject(env, instance)) {
     return 0;