Commit 31c8e7b1 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Commit Bot

Speculative fix for Surface strict mode crash.

Don't take ownership fo the local ref returned by
ANativeWindow_toSurface; just wrap it in a JavaParamRef to satisfy the
interface temporarily.

This is a speculative fix for the StrictMode crash; the introduction of
this Adopt appears to be the only functional change in the culprit CL,
so avoiding it might work; if so we can find a real solution afterward.

Bug: 1146071
Change-Id: Ie817bfbfa7dc531b6e4ddacde42ee5c021948451
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527563
Auto-Submit: Richard Coles <torne@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825797}
parent e33ddd0a
......@@ -240,12 +240,13 @@ gl::ScopedJavaSurface ImageReaderGLOwner::CreateJavaSurface() const {
// Get the java surface object from the Android native window.
JNIEnv* env = base::android::AttachCurrentThread();
auto j_surface = base::android::ScopedJavaLocalRef<jobject>::Adopt(
env, loader_.ANativeWindow_toSurface(env, window));
jobject j_surface = loader_.ANativeWindow_toSurface(env, window);
DCHECK(j_surface);
// Get the scoped java surface that is owned externally.
return gl::ScopedJavaSurface::AcquireExternalSurface(j_surface);
// TODO(1146071): use of JavaParamRef temporary to try to debug crash.
return gl::ScopedJavaSurface::AcquireExternalSurface(
base::android::JavaParamRef<jobject>(env, j_surface));
}
void ImageReaderGLOwner::UpdateTexImage() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment