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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 1711103002: Implement lifetime observer on RenderWidgetHostViewBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to r378132. Created 4 years, 10 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_child_frame.cc
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index f0c6f4ff40ae45ab3232a7e7e7b67abba113c904..5f4c0403202b0c7ad98ea480ac1c96ec1effa996 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -203,15 +203,18 @@ void RenderWidgetHostViewChildFrame::RenderProcessGone(
}
void RenderWidgetHostViewChildFrame::Destroy() {
+ // SurfaceIdNamespaces registered with RenderWidgetHostInputEventRouter
+ // have already been cleared when RenderWidgetHostViewBase notified its
+ // observers of our impending destruction.
if (frame_connector_) {
frame_connector_->set_view(NULL);
frame_connector_ = NULL;
}
- if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
- host_->delegate()->GetInputEventRouter()->RemoveSurfaceIdNamespaceOwner(
- GetSurfaceIdNamespace());
- }
+ // We notify our observers about shutdown here since we are about to release
+ // host_ and do not want any event calls coming from
+ // RenderWidgetHostInputEventRouter afterwards.
+ NotifyObserversAboutShutdown();
host_->SetView(NULL);
host_ = NULL;
@@ -363,25 +366,16 @@ uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() {
void RenderWidgetHostViewChildFrame::ProcessKeyboardEvent(
const NativeWebKeyboardEvent& event) {
- if (!host_)
- return;
-
host_->ForwardKeyboardEvent(event);
}
void RenderWidgetHostViewChildFrame::ProcessMouseEvent(
const blink::WebMouseEvent& event) {
- if (!host_)
- return;
-
host_->ForwardMouseEvent(event);
}
void RenderWidgetHostViewChildFrame::ProcessMouseWheelEvent(
const blink::WebMouseWheelEvent& event) {
- if (!host_)
- return;
-
if (event.deltaX != 0 || event.deltaY != 0)
host_->ForwardWheelEvent(event);
}
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698