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

Unified Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 1345353003: Fix detection of RenderViewHosts pending deletion in CreateRenderViewHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak test per Nasko's suggestions; fix pending RVH check Created 5 years, 3 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_view_host_impl.h
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index 08c12eb2f10c40beea33798b41a8fcdb57252210..e45f07db20fd44994b0f03c6c295c9630bde568a 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -221,6 +221,16 @@ class CONTENT_EXPORT RenderViewHostImpl
bool is_active() const { return is_active_; }
void set_is_active(bool is_active) { is_active_ = is_active; }
+ // Tracks whether this RenderViewHost is pending deletion. This is tracked
+ // separately from the main frame pending deletion state, because the
+ // RenderViewHost's main frame is cleared when the main frame's
+ // RenderFrameHost is marked for deletion.
+ //
+ // TODO(nasko,alexmos): This should not be necessary once swapped-out is
+ // removed.
+ bool is_pending_deletion() const { return is_pending_deletion_; }
+ void set_pending_deletion() { is_pending_deletion_ = true; }
+
// Tracks whether this RenderViewHost is swapped out, according to its main
// frame RenderFrameHost.
void set_is_swapped_out(bool is_swapped_out) {
@@ -443,6 +453,9 @@ class CONTENT_EXPORT RenderViewHostImpl
// it is not visible to the user in any of these cases.
bool is_active_;
+ // True if this RenderViewHost is pending deletion.
+ bool is_pending_deletion_;
+
// Tracks whether the main frame RenderFrameHost is swapped out. Unlike
// is_active_, this is false when the frame is pending swap out or deletion.
// TODO(creis): Remove this when we no longer use swappedout://.

Powered by Google App Engine
This is Rietveld 408576698