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

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

Issue 1711103002: Implement lifetime observer on RenderWidgetHostViewBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restructure, and make RWHVB derived classes responsible for early notification. 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index d78031f1fa4004f3483318d2fb8e844fe5484c60..3536d1b7b89f7d6cb72cdc161a1b94687ccd7699 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2486,6 +2486,10 @@ void RenderWidgetHostViewAura::OnHostMoved(const aura::WindowTreeHost* host,
// RenderWidgetHostViewAura, private:
RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
+ // If the observers were already notified through the Destroy() pathway, then
+ // this next call just returns.
kenrb 2016/02/22 17:05:10 Is this comment necessary? RWHVA::Destroy() doesn'
wjmaclean 2016/02/23 13:13:26 Done. Ooops, slightly stale comment, removed. Act
+ NotifyObserversAboutShutdown();
+
// Ask the RWH to drop reference to us.
if (!is_guest_view_hack_)
host_->ViewDestroyed();
@@ -2493,10 +2497,6 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
selection_controller_.reset();
selection_controller_client_.reset();
- if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
- host_->delegate()->GetInputEventRouter()->RemoveSurfaceIdNamespaceOwner(
- GetSurfaceIdNamespace());
- }
delegated_frame_host_.reset();
window_observer_.reset();
if (window_) {

Powered by Google App Engine
This is Rietveld 408576698