Chromium Code Reviews
Description[Android WebView] Propagate Java exceptions from JS dialog callbacks
WebView applications can throw run-time exceptions within
WebView-callbacks. When such an exception is thrown from either
onJsAlert, onJsConfirm, or onJsPrompt, it is not correctly propagated to
Android's feedback mechanism. This is because those callbacks are called
through JNI, and the default way of handling Java exceptions thrown on
the Java-side of JNI calls is to print the stack trace for the current
exception to the logcat when the JNI call returns to native, and then
intentionally crash in native.
With this CL we avoid the problem of propagating a Java exception back
through JNI and the native stack by posting the WebView-callback (which
can cause the Java exception) as a new task to the current Java Handler.
In that way any Java exception thrown inside the WebView-callback can be
propagated directly up to the Android framework's
UncaughtExceptionHandler which then properly reports the Exception
through the framework's crash reporting mechanism.
BUG=718921
Review-Url: https://codereview.chromium.org/2886963003
Cr-Commit-Position: refs/heads/master@{#472830}
Committed: https://chromium.googlesource.com/chromium/src/+/b5d138816ecd20145552720460906269c7f3a0fd
Patch Set 1 #
Messages
Total messages: 10 (5 generated)
|
|||||||||||||||||||