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

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

Issue 88503002: Have the unload event execute in background on cross-site navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keeping the old rvh alive for up to 1s Created 7 years 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 44851eea0e2983c78abd680af49322e2b72a555b..909e5714e2100f4a1757f50e182d8eb0d90bea0f 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -295,6 +295,20 @@ class CONTENT_EXPORT RenderViewHostImpl
// different process.
bool is_swapped_out() const { return is_swapped_out_; }
+ // Whether this RenderViewHost is waiting for the execution of the unload in
+ // the background, and should not be destroyed on SwapOut, even if it was the
+ // last active in the SiteInstance.
+ bool should_be_preserved_on_swap_out() const {
Charlie Reis 2013/12/09 20:12:29 I don't think we need these.
+ return should_be_preserved_on_swap_out_;
+ }
+
+ // Whether this RenderViewHostImpl needs to perform additional cleanup before
+ // being deleted. This is the case if the renderer was left to execute the
+ // unload event in the background.
+ bool need_to_perform_clean_up_on_swapped_out() const {
+ return need_to_perform_clean_up_on_swapped_out_;
+ }
+
// Called on the pending RenderViewHost when the network response is ready to
// commit. We should ensure that the old RenderViewHost runs its unload
// handler and determine whether a transfer to a different RenderViewHost is
@@ -324,7 +338,7 @@ class CONTENT_EXPORT RenderViewHostImpl
// Called when either the SwapOut request has been acknowledged or has timed
// out.
- void OnSwappedOut(bool timed_out);
+ void OnSwappedOut(bool timed_out, bool preserve_render_view_host);
Charlie Reis 2013/12/09 20:12:29 I think we can get rid of this whole method.
// Called to notify the renderer that it has been visibly swapped out and
// replaced by another RenderViewHost, after an earlier call to SwapOut.
@@ -708,6 +722,14 @@ class CONTENT_EXPORT RenderViewHostImpl
// is_waiting_for_beforeunload_ack_, unload_ack_is_for_cross_site_transition_.
bool is_waiting_for_unload_ack_;
+ // Set to true to prevent |this| to be killed when swapping out
+ // RenderViewHosts. This allows the unload handler to be run into background.
+ bool should_be_preserved_on_swap_out_;
+
+ // Set to true to have the renderer perform additional clean up if it had the
+ // unload handler run into the background previously.
+ bool need_to_perform_clean_up_on_swapped_out_;
+
// Set to true when waiting for ViewHostMsg_SwapOut_ACK has timed out.
bool has_timed_out_on_unload_;

Powered by Google App Engine
This is Rietveld 408576698