Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Issue 2887173004: [Android WebView] Propagate Java exceptions from handleJsBeforeUnload. (Closed)

Created:
3 years, 7 months ago by gsennton
Modified:
3 years, 7 months ago
Reviewers:
Torne
CC:
chromium-reviews, android-webview-reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -3 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java View 2 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (4 generated)
gsennton
ptal :)
3 years, 7 months ago (2017-05-18 17:37:19 UTC) #2
Torne
lgtm
3 years, 7 months ago (2017-05-18 18:48:35 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2887173004/1
3 years, 7 months ago (2017-05-18 19:14:45 UTC) #5
commit-bot: I haz the power
3 years, 7 months ago (2017-05-18 20:15:36 UTC) #8
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/e49ac49943ad77f452e6a586612b...

Powered by Google App Engine
This is Rietveld 408576698