Chromium Code Reviews
Description[Android WebView] Propagate Java exceptions from handleJsBeforeUnload.
WebView applications can throw run-time exceptions within
WebView-callbacks. When such an exception is thrown from either
onJsBeforeUnload, it is not correctly propagated to Android's feedback
mechanism. This is because that callbacks is called through JNI, and the
default way (in Chromium) 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=723699
Review-Url: https://codereview.chromium.org/2887173004
Cr-Commit-Position: refs/heads/master@{#472911}
Committed: https://chromium.googlesource.com/chromium/src/+/e49ac49943ad77f452e6a586612b2cfcae8d63ff
Patch Set 1 #
Messages
Total messages: 8 (4 generated)
|
|||||||||||||||||||