Commit b4a2e1e9 authored by Gustav Sennton's avatar Gustav Sennton Committed by Commit Bot

[Android WebView] remove global references to the support library

To support several versions of the WebView Support Library within the
same app/process we need to ensure the support library glue doesn't hold
any global state referencing the (app-side of the) support library.

With this CL we remove the only current global reference to the support
library: SupportLibraryInfo. The only information kept within that
reference was a list of feature flags. Those feature flags will now live
in individual callback objects instead, like WebViewClientCompat.

Corresponding Android Support Library CL:
https://googleplex-android-review.git.corp.google.com/#/c/platform/frameworks/support/+/3849471/

Bug: 752521
Change-Id: I9f8c67784fff9900f99b7c12f09f8cb1a39e64ea
Reviewed-on: https://chromium-review.googlesource.com/995212
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548576}
parent 26561f43
......@@ -13,7 +13,6 @@ android_library("boundary_interface_java") {
"src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/SupportLibraryInfoBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/VisualStateCallbackBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/WebResourceErrorBoundaryInterface.java",
"src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.support_lib_boundary;
/**
* Contains information about the WebView support library side, e.g. which features are supported on
* that side.
* This is passed to the WebView APK code on support library initialization.
*/
public interface SupportLibraryInfoBoundaryInterface { String[] getSupportedFeatures(); }
......@@ -20,10 +20,8 @@ public class SupportLibReflectionUtil {
* Changing the signature of this method will break existing WebView Support Library versions!
*/
@UsedByReflection("WebView Support Library")
public static InvocationHandler createWebViewProviderFactory(
/* SupportLibraryInfo */ InvocationHandler supportLibraryInfo) {
final SupportLibWebViewChromiumFactory factory =
new SupportLibWebViewChromiumFactory(supportLibraryInfo);
return BoundaryInterfaceReflectionUtil.createInvocationHandlerFor(factory);
public static InvocationHandler createWebViewProviderFactory() {
return BoundaryInterfaceReflectionUtil.createInvocationHandlerFor(
new SupportLibWebViewChromiumFactory());
}
}
......@@ -15,7 +15,6 @@ import com.android.webview.chromium.WebViewChromiumAwInit;
import com.android.webview.chromium.WebkitToSharedGlueConverter;
import org.chromium.support_lib_boundary.StaticsBoundaryInterface;
import org.chromium.support_lib_boundary.SupportLibraryInfoBoundaryInterface;
import org.chromium.support_lib_boundary.WebViewProviderFactoryBoundaryInterface;
import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil;
import org.chromium.support_lib_boundary.util.Features;
......@@ -30,7 +29,6 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary
// SupportLibWebkitToCompatConverterAdapter
private final InvocationHandler mCompatConverterAdapter;
private final WebViewChromiumAwInit mAwInit;
private final String[] mSupportLibrarySupportedFeatures;
private final String[] mWebViewSupportedFeatures =
new String[] {Features.VISUAL_STATE_CALLBACK};
......@@ -38,16 +36,10 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary
private InvocationHandler mStatics;
private InvocationHandler mServiceWorkerController;
public SupportLibWebViewChromiumFactory(
/* SupportLibraryInfo */ InvocationHandler supportLibraryInfo) {
public SupportLibWebViewChromiumFactory() {
mCompatConverterAdapter = BoundaryInterfaceReflectionUtil.createInvocationHandlerFor(
new SupportLibWebkitToCompatConverterAdapter());
mAwInit = WebkitToSharedGlueConverter.getGlobalAwInit();
mSupportLibrarySupportedFeatures =
BoundaryInterfaceReflectionUtil
.castToSuppLibClass(
SupportLibraryInfoBoundaryInterface.class, supportLibraryInfo)
.getSupportedFeatures();
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment