1 /* 2 * Copyright 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.webkit; 18 19 /** 20 * WebViewRenderProcess provides an opaque handle to a WebView renderer. 21 */ 22 public abstract class WebViewRenderProcess { 23 /** 24 * Cause this renderer to terminate. 25 * 26 * <p>Calling this on a not yet started, or an already terminated renderer will have no effect. 27 * 28 * <p>Terminating a renderer process may have an effect on multiple 29 * {@link android.webkit.WebView} instances. 30 * 31 * <p>RenderProcess termination must be handled by properly overriding 32 * {@link android.webkit.WebViewClient#onRenderProcessGone} for every WebView that shares this 33 * renderer. If termination is not handled by all associated WebViews, then the application 34 * process will also be terminated. 35 * 36 * <p>This method should only be called if 37 * {@link WebViewFeature#isFeatureSupported(String)} 38 * returns true for {@link WebViewFeature#WEB_VIEW_RENDERER_TERMINATE}. 39 * 40 * @return {@code true} if it was possible to terminate this renderer, {@code false} otherwise. 41 */ terminate()42 public abstract boolean terminate(); 43 WebViewRenderProcess()44 public WebViewRenderProcess() { 45 } 46 } 47