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

Issue 845422 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

onRenderProcessGone and a few browsers (Android WebView)

Reported by metro...@fun.co, May 22 2018

Issue description

Steps to reproduce the problem:
I have two browser on one screen.
I set WebViewClient and override onRenderProcessGone for first browser. 
Call w1.loadUrl("chrome://crash")

What is the expected behavior?

What went wrong?
I have crash. Because render process call WebViewClient by second browser, which return false (default behavior)

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 66.0.3359.158  Channel: stable
OS Version: 8.1.0
Flash Version: 

Example

public class MainActivity extends AppCompatActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		WebView w1 = findViewById(R.id.w1);
		WebView w2 = findViewById(R.id.w2);

		w1.setWebViewClient(new WebViewClient() {
			@Override
			public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
				return true;
			}
		});

		w1.loadUrl("chrome://crash");
	}
}
 
Components: Mobile>WebView
This is WAI. All WebViews have to have set a WebViewClient that overrides onRenderProcessGone to handle the crash.

Comment 3 by metro...@fun.co, May 22 2018

I have ad libraries and dont have access to they webviews. But I want to handle crashes for only my webview. Can I separate crashes beetween webviews?
Sadly, the answer is not easily, without the Ad SDK also handling the same callback. It's a flaw that we're aware of in the current design, and we're working to come up with a better answer.

Which Ad SDK are you using, out of curiosity?

Comment 5 by torne@chromium.org, May 22 2018

Yeah, right now there is just one renderer process that's being used by all WebViews in a given application, so if it crashes, then all WebViews are now in a broken state and all need to handle the crash to allow us to continue. The only way to handle crashes separately would be to use separate renderer processes for different WebViews and we don't support that yet, though we're investigating ways to permit applications to do this in future.
Cc: jamwalla@chromium.org
Status: WontFix (was: Unconfirmed)
This is unfortunately as WAI per #2. The ad libraries need to handle the crash as well.

I'll close this issue for now, if you still have any questions regarding this bug, feel free to reopen it. Thanks!

Comment 7 by metro...@fun.co, May 24 2018

We use Google Mobile Ads, Prebid, OpenX, etc. All these libraries create Webview. Google mobile Ads create WebView in some inner classes (package have '.internal')
Some libraries have next code 'String userAgent = new WebView(context).getSettings().getUserAgentString()'
And after that we have new default WebViewClient bound with render process.
This is very big limitation for using this API

Comment 8 by torne@chromium.org, May 24 2018

Yes, this is a big limitation. Ad SDKs need to be updated to also use this API appropriately. You should contact the vendors of the ad SDKs you use.

Sign in to add a comment