Chromium Code Reviews| Index: ui/gl/android/scoped_java_surface.cc |
| diff --git a/ui/gl/android/scoped_java_surface.cc b/ui/gl/android/scoped_java_surface.cc |
| index ae4f81a44bd82a23e9e83f0b5a9f4c7b0bea2e27..ff0862300acdf0ce4c963ac64d4f086fe4eb3d7d 100644 |
| --- a/ui/gl/android/scoped_java_surface.cc |
| +++ b/ui/gl/android/scoped_java_surface.cc |
| @@ -75,6 +75,14 @@ bool ScopedJavaSurface::IsEmpty() const { |
| return j_surface_.is_null(); |
| } |
| +bool ScopedJavaSurface::IsValid() const { |
| + // Null surface are considered valid as it can be passed to a MediaPlayer. |
| + if (IsEmpty()) |
| + return true; |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + return JNI_Surface::Java_Surface_isValid(env, j_surface_.obj()); |
|
no sievers
2015/10/08 23:00:27
Are you sure we need to check this? Or is it good
qinmin
2015/10/08 23:47:23
removed this function. When surfaceDestroyed() is
|
| +} |
| + |
| // static |
| ScopedJavaSurface ScopedJavaSurface::AcquireExternalSurface(jobject surface) { |
| JNIEnv* env = base::android::AttachCurrentThread(); |