Commit 28bab43f authored by Keishi Hattori's avatar Keishi Hattori Committed by Commit Bot

Ensure Page exists in EventHandlerRegistry::NotifyHandlersChanged

According to crbug.com/1090687 NotifyHandlersChanged() is getting called when GetPage() returns null (i.e. after Frame is detached)

To avoid the crashes this adds a check for GetPage().

Bug: 1090687
Change-Id: I154a121c96a0ac39db6a5066c8bb3940eb006838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2234325Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776060}
parent b6b99e74
...@@ -248,6 +248,11 @@ void EventHandlerRegistry::NotifyHandlersChanged( ...@@ -248,6 +248,11 @@ void EventHandlerRegistry::NotifyHandlersChanged(
bool has_active_handlers) { bool has_active_handlers) {
LocalFrame* frame = GetLocalFrameForTarget(target); LocalFrame* frame = GetLocalFrameForTarget(target);
// TODO(keishi): Added for crbug.com/1090687. Change to CHECK once bug is
// fixed.
if (!GetPage())
return;
switch (handler_class) { switch (handler_class) {
case kScrollEvent: case kScrollEvent:
GetPage()->GetChromeClient().SetHasScrollEventHandlers( GetPage()->GetChromeClient().SetHasScrollEventHandlers(
......
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