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

Unified Diff: content/browser/renderer_host/render_widget_host_input_event_router.cc

Issue 2396083002: Clear last MouseMove root view in RWHIER if that view gets destroyed (Closed)
Patch Set: Try re-enabling tests Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_input_event_router.cc
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index b0b580f1a0c9a1434153c6bf847f60f7f8ceefe0..6c95a3a2e6f3bcfacb673e118140584e941011f2 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -90,7 +90,7 @@ void RenderWidgetHostInputEventRouter::OnRenderWidgetHostViewBaseDestroyed(
else
last_mouse_move_target_ = nullptr;
- if (!last_mouse_move_target_)
+ if (!last_mouse_move_target_ || view == last_mouse_move_root_view_)
last_mouse_move_root_view_ = nullptr;
}
}
@@ -383,13 +383,18 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents(
RenderWidgetHostViewBase* cur_view = target;
entered_views.push_back(cur_view);
while (cur_view != root_view) {
- // Non-root RWHVs are guaranteed to be RenderWidgetHostViewChildFrames.
+ // Non-root RWHVs are guaranteed to be RenderWidgetHostViewChildFrames,
+ // as long as they are the only embeddable RWHVs.
+ CHECK(cur_view->IsRenderWidgetHostViewChildFrame());
ncarter (slow) 2016/10/07 17:52:27 If we can't guarantee this via static typing, then
kenrb 2016/10/07 18:44:24 I'm not clear on how that would work. RWHVCF::GetP
cur_view =
static_cast<RenderWidgetHostViewChildFrame*>(cur_view)->GetParentView();
// cur_view can possibly be nullptr for guestviews that are not currently
// connected to the webcontents tree.
- if (!cur_view)
- break;
+ if (!cur_view) {
+ last_mouse_move_target_ = target;
+ last_mouse_move_root_view_ = root_view;
+ return;
+ }
entered_views.push_back(cur_view);
}
@@ -397,10 +402,14 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents(
if (cur_view) {
exited_views.push_back(cur_view);
while (cur_view != root_view) {
+ CHECK(cur_view->IsRenderWidgetHostViewChildFrame());
cur_view = static_cast<RenderWidgetHostViewChildFrame*>(cur_view)
->GetParentView();
- if (!cur_view)
- break;
+ if (!cur_view) {
+ last_mouse_move_target_ = target;
+ last_mouse_move_root_view_ = root_view;
+ return;
+ }
exited_views.push_back(cur_view);
}
}

Powered by Google App Engine
This is Rietveld 408576698