Bug 1413230 - Expose updateTexImage() and releaseTexImage() failures in GeckoSurfaceTexture JNI wrapper r=jchen
MozReview-Commit-ID: LZ9n9wjXLDL
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurfaceTexture.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurfaceTexture.java
@@ -83,42 +83,34 @@ public final class GeckoSurfaceTexture e
}
@WrapForJNI
public boolean isSingleBuffer() {
return mIsSingleBuffer;
}
@Override
- @WrapForJNI
+ @WrapForJNI(exceptionMode = "nsresult")
public synchronized void updateTexImage() {
- try {
- super.updateTexImage();
- if (mListener != null) {
- mListener.onUpdateTexImage();
- }
- } catch (Exception e) {
- Log.w(LOGTAG, "updateTexImage() failed", e);
+ super.updateTexImage();
+ if (mListener != null) {
+ mListener.onUpdateTexImage();
}
}
@Override
- @WrapForJNI
+ @WrapForJNI(exceptionMode = "nsresult")
public synchronized void releaseTexImage() {
if (!mIsSingleBuffer) {
return;
}
- try {
- super.releaseTexImage();
- if (mListener != null) {
- mListener.onReleaseTexImage();
- }
- } catch (Exception e) {
- Log.w(LOGTAG, "releaseTexImage() failed", e);
+ super.releaseTexImage();
+ if (mListener != null) {
+ mListener.onReleaseTexImage();
}
}
public synchronized void setListener(GeckoSurfaceTexture.Callbacks listener) {
mListener = listener;
}
@WrapForJNI
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ b/widget/android/GeneratedJNIWrappers.cpp
@@ -1202,27 +1202,31 @@ constexpr char GeckoSurfaceTexture::Look
auto GeckoSurfaceTexture::Lookup(int32_t a0) -> GeckoSurfaceTexture::LocalRef
{
return mozilla::jni::Method<Lookup_t>::Call(GeckoSurfaceTexture::Context(), nullptr, a0);
}
constexpr char GeckoSurfaceTexture::ReleaseTexImage_t::name[];
constexpr char GeckoSurfaceTexture::ReleaseTexImage_t::signature[];
-auto GeckoSurfaceTexture::ReleaseTexImage() const -> void
+auto GeckoSurfaceTexture::ReleaseTexImage() const -> nsresult
{
- return mozilla::jni::Method<ReleaseTexImage_t>::Call(GeckoSurfaceTexture::mCtx, nullptr);
+ nsresult rv = NS_OK;
+ mozilla::jni::Method<ReleaseTexImage_t>::Call(GeckoSurfaceTexture::mCtx, &rv);
+ return rv;
}
constexpr char GeckoSurfaceTexture::UpdateTexImage_t::name[];
constexpr char GeckoSurfaceTexture::UpdateTexImage_t::signature[];
-auto GeckoSurfaceTexture::UpdateTexImage() const -> void
+auto GeckoSurfaceTexture::UpdateTexImage() const -> nsresult
{
- return mozilla::jni::Method<UpdateTexImage_t>::Call(GeckoSurfaceTexture::mCtx, nullptr);
+ nsresult rv = NS_OK;
+ mozilla::jni::Method<UpdateTexImage_t>::Call(GeckoSurfaceTexture::mCtx, &rv);
+ return rv;
}
const char LayerView::name[] =
"org/mozilla/gecko/gfx/LayerView";
constexpr char LayerView::GetCompositor_t::name[];
constexpr char LayerView::GetCompositor_t::signature[];
--- a/widget/android/GeneratedJNIWrappers.h
+++ b/widget/android/GeneratedJNIWrappers.h
@@ -3659,43 +3659,43 @@ public:
typedef void ReturnType;
typedef void SetterType;
typedef mozilla::jni::Args<> Args;
static constexpr char name[] = "releaseTexImage";
static constexpr char signature[] =
"()V";
static const bool isStatic = false;
static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto ReleaseTexImage() const -> void;
+ mozilla::jni::ExceptionMode::NSRESULT;
+ static const mozilla::jni::CallingThread callingThread =
+ mozilla::jni::CallingThread::ANY;
+ static const mozilla::jni::DispatchTarget dispatchTarget =
+ mozilla::jni::DispatchTarget::CURRENT;
+ };
+
+ auto ReleaseTexImage() const -> nsresult;
struct UpdateTexImage_t {
typedef GeckoSurfaceTexture Owner;
typedef void ReturnType;
typedef void SetterType;
typedef mozilla::jni::Args<> Args;
static constexpr char name[] = "updateTexImage";
static constexpr char signature[] =
"()V";
static const bool isStatic = false;
static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto UpdateTexImage() const -> void;
+ mozilla::jni::ExceptionMode::NSRESULT;
+ static const mozilla::jni::CallingThread callingThread =
+ mozilla::jni::CallingThread::ANY;
+ static const mozilla::jni::DispatchTarget dispatchTarget =
+ mozilla::jni::DispatchTarget::CURRENT;
+ };
+
+ auto UpdateTexImage() const -> nsresult;
static const mozilla::jni::CallingThread callingThread =
mozilla::jni::CallingThread::ANY;
};
class LayerView : public mozilla::jni::ObjectBase<LayerView>
{