New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 788177 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 832560



Sign in to add a comment

Generate webview support library boundary interfaces

Project Member Reported by gsennton@chromium.org, Nov 23 2017

Issue description

To communicate between the webview support library and the webview glue both these modules will be built against a set of interfaces defined in the chromium source tree, here:
https://cs.chromium.org/chromium/src/android_webview/support_library/boundary_interfaces/

These interfaces will be defined in a way that they can be passed across different class loaders - i.e. they will only reference objects that share a definition in both class loaders (objects that are defined in the parent classloader - the android framework classloader).

These 'boundary interfaces' should be fairly straight-forward to generate - they should contain the same APIs as the existing android.webkit classes/interfaces used for communication between android.webkit and the existing webview glue, except any method parameters/return values that point to objects defined in android.webkit should be turned into InvocationHandlers.
e.g
1. void WebView.postVisualStateCallback(long, VisualStateCallback) ->
void WebView.postVisualStateCallback(long, InvocationHandler);
2. void WebView.setWebViewClient(WebViewClient) -> 
void WebView.setWebViewClient(InvocationHandler)
3. boolean WebViewClient.shouldOverrideUrlLoading(WebView, WebResourceRequest) ->
boolean WebViewClient.shouldOverrideUrlLoading(InvocationHandler, InvocationHandler)


Note that the boundary interfaces should all be pure interfaces (no abstract classes) because of how InvocationHandlers + Proxies work.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4235bf67f2a85c2e044b22b4cf37e2243c1912ac

commit 4235bf67f2a85c2e044b22b4cf37e2243c1912ac
Author: Gustav Sennton <gsennton@google.com>
Date: Fri Feb 09 15:10:33 2018

Rename boundary interfaces, and pass WebView to WVFP.createWebView.

Suffix all boundary interfaces with 'BoundaryInterfaces'.

Pass WebView instead of an Object representing a WebViewProvider to the
method for creating support library WebViewProviders - the chromium-side
is compiled against the system sdk so we can fetch the corresponding
WebViewProvider from the given WebView from there.

Bug:  788177 
Change-Id: I51d71ecab79624902031e5fdab247f7d903ae335
Reviewed-on: https://chromium-review.googlesource.com/911088
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535714}
[modify] https://crrev.com/4235bf67f2a85c2e044b22b4cf37e2243c1912ac/android_webview/support_library/boundary_interfaces/BUILD.gn
[add] https://crrev.com/4235bf67f2a85c2e044b22b4cf37e2243c1912ac/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/VisualStateCallbackBoundaryInterface.java
[delete] https://crrev.com/5aafcc668a265a6014c7f052a54fe32fb5c3a1bc/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/VisualStateCallbackInterface.java
[rename] https://crrev.com/4235bf67f2a85c2e044b22b4cf37e2243c1912ac/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java
[delete] https://crrev.com/5aafcc668a265a6014c7f052a54fe32fb5c3a1bc/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebViewProvider.java
[add] https://crrev.com/4235bf67f2a85c2e044b22b4cf37e2243c1912ac/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebViewProviderBoundaryInterface.java
[delete] https://crrev.com/5aafcc668a265a6014c7f052a54fe32fb5c3a1bc/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebViewProviderFactory.java
[add] https://crrev.com/4235bf67f2a85c2e044b22b4cf37e2243c1912ac/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java

Project Member

Comment 2 by bugdroid1@chromium.org, Feb 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0293525c239e35235b4ea8375d84956b4185efad

commit 0293525c239e35235b4ea8375d84956b4185efad
Author: Gustav Sennton <gsennton@google.com>
Date: Wed Feb 14 15:43:45 2018

[Boundary interfaces] Add a package file to hide boundary interfaces

Android publishes all public APIs that are not marked with the @hide
annotation.
Boundary interfaces are not supposed to be public to apps. In this CL we
add a file with the sole purpose of hiding the boundary interface
package from apps.

Bug:  788177 
Change-Id: I58c9c7a8445c1a3fdfda3164735f5e2c755dfc44
Reviewed-on: https://chromium-review.googlesource.com/918861
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536719}
[add] https://crrev.com/0293525c239e35235b4ea8375d84956b4185efad/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/package-info.java

Project Member

Comment 3 by bugdroid1@chromium.org, Feb 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e5f7a795c810e53cf9d0bfa6b7c31fd21c3b3e1c

commit e5f7a795c810e53cf9d0bfa6b7c31fd21c3b3e1c
Author: Gustav Sennton <gsennton@google.com>
Date: Wed Feb 14 15:45:25 2018

[Boundary interfaces] Add utility methods for support library boundary

The WebView support library (in the Android Support Library) and the
WebView support library glue (in Chromium) will both need methods for
mapping a class loaded in some ClassLoader into a class loaded in the
current ClassLoader.
In this CL we put that utility in the boundary interface directory to
avoid duplicating this Class-conversion functionality in both the
Android Support Library and Chromium (instead this functionality will be
mirrored from Chromium into the support library).

Bug:  788177 
Change-Id: Icea382115bedd53d1b255d3a115fff03fcdb15ba
Reviewed-on: https://chromium-review.googlesource.com/919062
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536720}
[modify] https://crrev.com/e5f7a795c810e53cf9d0bfa6b7c31fd21c3b3e1c/android_webview/support_library/boundary_interfaces/BUILD.gn
[add] https://crrev.com/e5f7a795c810e53cf9d0bfa6b7c31fd21c3b3e1c/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/BoundaryInterfaceReflectionUtil.java

Blocking: -788138
Labels: -M-65
Blocking: 832560
Status: WontFix (was: Assigned)
Closing this for now since we're no longer pursuing code generation for the support library.

Sign in to add a comment