This callback is very similar to the RunJavaScriptDialog one (but with a slightly different call stack).
If we can solve the RunJavaScriptDialog bug by posting the Java-callback back to the current thread (https://codereview.chromium.org/2886963003/) we can probably do so with this callback as well.
debugger_posix.cc:221 ) base::debug::BreakDebugger()
jni_android.cc:243 ) base::android::CheckException(_JNIEnv*)
jni_generator_helper.h:42 ) android_webview::AwContentsClientBridge::RunBeforeUnloadDialog(...)
aw_javascript_dialog_manager.cc:48 ) android_webview::AwJavaScriptDialogManager::RunBeforeUnloadDialog(...)
web_contents_impl.cc:4228 ) content::WebContentsImpl::RunBeforeUnloadConfirm(content::RenderFrameHost*, bool, IPC::Message*)
render_frame_host_impl.cc:1704 ) content::RenderFrameHostImpl::OnRunBeforeUnloadConfirm(GURL const&, bool, IPC::Message*)
tuple.h:131 ) content::RenderFrameHostImpl::OnMessageReceived(IPC::Message const&)
render_process_host_impl.cc:2081 ) content::RenderProcessHostImpl::OnMessageReceived(IPC::Message const&)
ipc_channel_proxy.cc:329 ) IPC::ChannelProxy::Context::OnDispatchMessage(IPC::Message const&)
ipc_sync_channel.cc:184 ) IPC::SyncChannel::ReceivedSyncMsgQueue::DispatchMessages(IPC::SyncChannel::SyncContext*)
bind_internal.h:214 ) Run
callback.h:85 ) mojo::Watcher::OnHandleReady(unsigned int)
bind_internal.h:214 ) Run
callback.h:68 ) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*)
message_loop.cc:423 ) base::MessageLoop::RunTask(base::PendingTask*)
message_loop.cc:434 ) base::MessageLoop::DeferOrRunPendingTask(base::PendingTask)
message_loop.cc:527 ) base::MessageLoop::DoWork()
message_pump_android.cc:44 ) Java_org_chromium_base_SystemMessageHandler_nativeDoRunLoopOnce
This crash accounts for less than 1.5% of JNI crashes on 58.
Comment 1 by bugdroid1@chromium.org
, May 18 2017