mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-16 10:57:17 +01:00
60 lines
3.3 KiB
Java
60 lines
3.3 KiB
Java
package androidx.webkit.internal;
|
|
|
|
import androidx.webkit.WebViewRenderProcess;
|
|
import androidx.webkit.internal.ApiFeature;
|
|
import java.lang.ref.WeakReference;
|
|
import java.lang.reflect.InvocationHandler;
|
|
import java.util.WeakHashMap;
|
|
import org.apache.commons.lang3.Functions$$ExternalSyntheticLambda19;
|
|
import org.chromium.support_lib_boundary.WebViewRendererBoundaryInterface;
|
|
import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes14.dex */
|
|
public class WebViewRenderProcessImpl extends WebViewRenderProcess {
|
|
private static final WeakHashMap<android.webkit.WebViewRenderProcess, WebViewRenderProcessImpl> sFrameworkMap = new WeakHashMap<>();
|
|
private WebViewRendererBoundaryInterface mBoundaryInterface;
|
|
private WeakReference<android.webkit.WebViewRenderProcess> mFrameworkObject;
|
|
|
|
public WebViewRenderProcessImpl(android.webkit.WebViewRenderProcess webViewRenderProcess) {
|
|
this.mFrameworkObject = new WeakReference<>(webViewRenderProcess);
|
|
}
|
|
|
|
public static WebViewRenderProcessImpl forFrameworkObject(android.webkit.WebViewRenderProcess webViewRenderProcess) {
|
|
WeakHashMap<android.webkit.WebViewRenderProcess, WebViewRenderProcessImpl> weakHashMap = sFrameworkMap;
|
|
WebViewRenderProcessImpl webViewRenderProcessImpl = weakHashMap.get(webViewRenderProcess);
|
|
if (webViewRenderProcessImpl != null) {
|
|
return webViewRenderProcessImpl;
|
|
}
|
|
WebViewRenderProcessImpl webViewRenderProcessImpl2 = new WebViewRenderProcessImpl(webViewRenderProcess);
|
|
weakHashMap.put(webViewRenderProcess, webViewRenderProcessImpl2);
|
|
return webViewRenderProcessImpl2;
|
|
}
|
|
|
|
public static WebViewRenderProcessImpl forInvocationHandler(InvocationHandler invocationHandler) {
|
|
WebViewRendererBoundaryInterface webViewRendererBoundaryInterface = (WebViewRendererBoundaryInterface) BoundaryInterfaceReflectionUtil.castToSuppLibClass(WebViewRendererBoundaryInterface.class, invocationHandler);
|
|
return (WebViewRenderProcessImpl) webViewRendererBoundaryInterface.getOrCreatePeer(new Functions$$ExternalSyntheticLambda19(webViewRendererBoundaryInterface, 2));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ Object lambda$forInvocationHandler$0(WebViewRendererBoundaryInterface webViewRendererBoundaryInterface) throws Exception {
|
|
return new WebViewRenderProcessImpl(webViewRendererBoundaryInterface);
|
|
}
|
|
|
|
@Override // androidx.webkit.WebViewRenderProcess
|
|
public boolean terminate() {
|
|
ApiFeature.Q q = WebViewFeatureInternal.WEB_VIEW_RENDERER_TERMINATE;
|
|
if (q.isSupportedByFramework()) {
|
|
android.webkit.WebViewRenderProcess webViewRenderProcess = this.mFrameworkObject.get();
|
|
return webViewRenderProcess != null && ApiHelperForQ.terminate(webViewRenderProcess);
|
|
}
|
|
if (q.isSupportedByWebView()) {
|
|
return this.mBoundaryInterface.terminate();
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
|
|
public WebViewRenderProcessImpl(WebViewRendererBoundaryInterface webViewRendererBoundaryInterface) {
|
|
this.mBoundaryInterface = webViewRendererBoundaryInterface;
|
|
}
|
|
}
|