Index: content/browser/frame_host/render_frame_host_impl.h |
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h |
index 7b40b9da8db2ce29171cdd0deb5eb32f3fcfcf0d..daab06b6504d29f27749fa1f55e3c2856e37c71a 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.h |
+++ b/content/browser/frame_host/render_frame_host_impl.h |
@@ -252,6 +252,16 @@ class CONTENT_EXPORT RenderFrameHostImpl |
// Whether the RFH is waiting for an unload ACK from the renderer. |
bool IsWaitingForUnloadACK() const; |
+ // Whether sudden termination is allowed for this frame. |
Charlie Reis
2015/01/23 06:01:32
Briefly mention what conditions determine this.
clamy
2015/01/26 16:38:40
Done.
|
+ bool SuddenTerminationAllowed() const; |
+ |
+ // Called by the browser to override or not the sudden termination status of |
Charlie Reis
2015/01/23 06:01:32
nit: (or not)
clamy
2015/01/26 16:38:39
Done.
|
+ // the frame. When overriden, sudden termination is always allowed, even if |
+ // some disablers are present for the frame. |
Charlie Reis
2015/01/23 06:01:32
"disablers" isn't a well-defined term in the code.
clamy
2015/01/26 16:38:39
Done.
|
+ void set_override_sudden_termination_status(bool enabled) { |
+ override_sudden_termination_status_ = enabled; |
+ } |
+ |
// Called when either the SwapOut request has been acknowledged or has timed |
// out. |
void OnSwappedOut(); |
@@ -468,6 +478,8 @@ class CONTENT_EXPORT RenderFrameHostImpl |
void OnAccessibilityFindInPageResult( |
const AccessibilityHostMsg_FindInPageResultParams& params); |
void OnToggleFullscreen(bool enter_fullscreen); |
+ void OnBeforeUnloadHandlersPresenceChanged(bool present); |
+ void OnUnloadHandlersPresenceChanged(bool present); |
Charlie Reis
2015/01/23 06:01:32
These names are a bit unwieldy. Would On{Before}U
clamy
2015/01/26 16:38:40
Done.
|
#if defined(OS_MACOSX) || defined(OS_ANDROID) |
void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); |
@@ -506,6 +518,12 @@ class CONTENT_EXPORT RenderFrameHostImpl |
// Informs the content client that geolocation permissions were used. |
void DidUseGeolocationPermission(); |
+ // Handle a change in presence for one of the sudden termination disablers. |
+ // Signals the RenderProcessHost if the sudden termination status for this |
+ // frame changes. |
+ void HandleSuddenTerminationDisablerPresenceChange(bool* disabler_presence, |
+ bool new_value); |
+ |
// For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
// refcount that calls Shutdown when it reaches zero. This allows each |
// RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
@@ -625,6 +643,17 @@ class CONTENT_EXPORT RenderFrameHostImpl |
// Context shared for each PermissionService instance created for this RFH. |
scoped_ptr<PermissionServiceContext> permission_service_context_; |
+ // Used to track whether sudden termination is allowed for this frame. |
+ // has_beforeunload_handlers_ and has_unload_handlers_ are also used to skip |
+ // waiting for the execution of BeforeUnload and Unload if they are false. The |
Charlie Reis
2015/01/23 06:01:32
...to avoid asking the renderer process to run Bef
clamy
2015/01/26 16:38:39
Done.
|
+ // browser can set override_sudden_termination_status_ to true, in which case |
+ // sudden termination will be allowed. This is used when a renderer executing |
+ // BeforeUnload or Unload is unresponsive. All other values are modified based |
+ // on IPCs received from the renderer. |
+ bool has_beforeunload_handlers_; |
Charlie Reis
2015/01/23 06:01:32
nit: Please put these near the other *unload membe
clamy
2015/01/26 16:38:40
Done.
|
+ bool has_unload_handlers_; |
+ bool override_sudden_termination_status_; |
+ |
// NOTE: This must be the last member. |
base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |