dupeMethod uses the wrong ClassLoader |
|||
Issue descriptioncreateInvocationHandlerFor() is documented [1] as delegating method calls to the |delegate| parameter, looking up methods in that object's ClassLoader (more precisely: methods on the corresponding BoundaryInterface defined in delegate's ClassLoader). However, dupeMethod() is implemented such that it uses Class.forName(String) [2], which looks in the "currentLoader," defined as the ClassLoader for the current class (in this case, the version of BoundaryInterfaceReflectionUtil from either the app-side or chromium-side, depending where it's called from). This means that invoking createInvocationHandlerFor on the chromium side for an app-defined object will return a bad InvocationHandler, since dupeMethod() will return chromium-side Methods instead of the app-side Methods that the app-side object actually has. This bug should be invisible when creating an InvocationHandler on the same side as the object is defined (which is what gsennton@ has done so far), but will be a RuntimeException when creating an InvocationHandler on the opposite side (which we need for WebViewClientCompat). [1] https://cs.chromium.org/chromium/src/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java?l=51&rcl=19fcd2685b4af798be5d736627881c1a8c091320 [2] https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#forName(java.lang.String)
,
Mar 29 2018
No manual verification necessary.
,
Aug 24
Bulk edit: marking stale 'fixed' bugs as 'verified' since they don't need verification at this point. |
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Mar 29 2018