Commit c96d445d authored by David Bokan's avatar David Bokan Committed by Commit Bot

Add debug CHECK for WebView closing during input

Looking at code and the crash stacks, it looks like we're synchronously
closing a WebViewImpl while it's handling an input event.

This CL adds some debugging to crash earlier so we can get a stack
showing where the Close call is coming from.

Bug: 992315
Change-Id: I16b17cbbec6dfdafadfc334028a31227ae61ccae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769348
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691021}
parent c9109551
......@@ -1237,6 +1237,10 @@ void WebViewImpl::Close() {
animation_host_ = nullptr;
}
// TODO(bokan): Temporary debugging added to diagnose
// https://crbug.com/992315. Somehow we're synchronously calling
// WebViewImpl::Close while handling an input event.
CHECK(!debug_inside_input_handling_);
AsView().page.Clear();
// Reset the delegate to prevent notifications being sent as we're being
......@@ -1690,6 +1694,12 @@ WebInputEventResult WebViewImpl::DispatchBufferedTouchEvents() {
WebInputEventResult WebViewImpl::HandleInputEvent(
const WebCoalescedInputEvent& coalesced_event) {
// TODO(bokan): Temporary debugging added to diagnose
// https://crbug.com/992315. Somehow we're synchronously calling
// WebViewImpl::Close while handling an input event.
base::AutoReset<bool> inside_input_handling(&debug_inside_input_handling_,
true);
const WebInputEvent& input_event = coalesced_event.Event();
// TODO(dcheng): The fact that this is getting called when there is no local
// main frame is problematic and probably indicates a bug in the input event
......
......@@ -674,6 +674,11 @@ class CORE_EXPORT WebViewImpl final : public WebView,
bool should_dispatch_first_layout_after_finished_loading_ = false;
WebDisplayMode display_mode_ = kWebDisplayModeBrowser;
// TODO(bokan): Temporary debugging added to diagnose
// https://crbug.com/992315. Somehow we're synchronously calling
// WebViewImpl::Close while handling an input event.
bool debug_inside_input_handling_ = false;
FloatSize elastic_overscroll_;
Persistent<EventListener> popup_mouse_wheel_event_listener_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment