[go: nahoru, domu]

jni_zero: Change name mangling scheme for CalledByNatives

The previous scheme:
* was kinda confusing since it made acronyms out of names
* didn't actually guarantee unique names
* encoded return types despite them not participating in overload resolution

The new scheme:
* Uses C++ overloads when the number of parameters is unique (often the case)
* Does not encode return types
* Uses full names for types, but removes package when possible
* Guarantees unique names

Updates all Chrome code that was using methods with mangled names.

Bug: 1406605
Change-Id: Id18845ddafd4e6e2ff14ce5aa1b250beea438374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706293
Reviewed-by: Sam Maier <smaier@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1174255}
diff --git a/ui/gl/android/scoped_java_surface.cc b/ui/gl/android/scoped_java_surface.cc
index 6c8db38..e1e029e0 100644
--- a/ui/gl/android/scoped_java_surface.cc
+++ b/ui/gl/android/scoped_java_surface.cc
@@ -27,8 +27,9 @@
 
 ScopedJavaSurface::ScopedJavaSurface(const SurfaceTexture* surface_texture) {
   JNIEnv* env = base::android::AttachCurrentThread();
-  ScopedJavaLocalRef<jobject> tmp(JNI_Surface::Java_Surface_ConstructorAVS_AGST(
-      env, surface_texture->j_surface_texture()));
+  ScopedJavaLocalRef<jobject> tmp(
+      JNI_Surface::Java_Surface_Constructor__android_graphics_SurfaceTexture(
+          env, surface_texture->j_surface_texture()));
   DCHECK(!tmp.is_null());
   j_surface_.Reset(tmp);
 }