Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: ui/gl/android/scoped_java_surface.cc

Issue 2202033002: ui: Remove unneeded RegisterNatives() call on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jnireg1
Patch Set: rebase, unused headers Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/android/gl_jni_registrar.cc ('k') | ui/gl/android/surface_texture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 feb1e6905d988fcb0812293eed6c066b8e0c26c0..c3f37344ed217dc3b43667a9236c23018377818c 100644
--- a/ui/gl/android/scoped_java_surface.cc
+++ b/ui/gl/android/scoped_java_surface.cc
@@ -8,19 +8,6 @@
#include "jni/Surface_jni.h"
#include "ui/gl/android/surface_texture.h"
-namespace {
-
-bool g_jni_initialized = false;
-
-void RegisterNativesIfNeeded(JNIEnv* env) {
- if (!g_jni_initialized) {
- JNI_Surface::RegisterNativesImpl(env);
- g_jni_initialized = true;
- }
-}
-
-} // anonymous namespace
-
namespace gl {
ScopedJavaSurface::ScopedJavaSurface() {
@@ -31,7 +18,6 @@ ScopedJavaSurface::ScopedJavaSurface(
: auto_release_(true),
is_protected_(false) {
JNIEnv* env = base::android::AttachCurrentThread();
- RegisterNativesIfNeeded(env);
DCHECK(env->IsInstanceOf(surface.obj(), Surface_clazz(env)));
j_surface_.Reset(surface);
}
@@ -41,7 +27,6 @@ ScopedJavaSurface::ScopedJavaSurface(
: auto_release_(true),
is_protected_(false) {
JNIEnv* env = base::android::AttachCurrentThread();
- RegisterNativesIfNeeded(env);
ScopedJavaLocalRef<jobject> tmp(JNI_Surface::Java_Surface_Constructor(
env, surface_texture->j_surface_texture().obj()));
DCHECK(!tmp.is_null());
« no previous file with comments | « ui/gl/android/gl_jni_registrar.cc ('k') | ui/gl/android/surface_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698