Chromium Code Reviews| 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 3a2138f2fc9120b8cffcf93330b5c848fdf4db04..7f388b764957d12985593a0f3137cf5df1ac11c8 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.h |
| +++ b/content/browser/frame_host/render_frame_host_impl.h |
| @@ -96,21 +96,6 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost, |
| base::Callback<void( |
| const ui::AXTreeUpdate&)>; |
| - // Keeps track of the state of the RenderFrameHostImpl, particularly with |
| - // respect to swap out. |
| - enum RenderFrameHostImplState { |
| - // The standard state for a RFH handling the communication with an active |
| - // RenderFrame. |
| - STATE_DEFAULT = 0, |
| - // The RFH has not received the SwapOutACK yet, but the new page has |
| - // committed in a different RFH. Upon reception of the SwapOutACK, the RFH |
| - // will be deleted. |
| - STATE_PENDING_SWAP_OUT, |
| - }; |
| - // Helper function to determine whether the RFH state should contribute to the |
| - // number of active frames of a SiteInstance or not. |
| - static bool IsRFHStateActive(RenderFrameHostImplState rfh_state); |
| - |
| // An accessibility reset is only allowed to prevent very rare corner cases |
| // or race conditions where the browser and renderer get out of sync. If |
| // this happens more than this many times, kill the renderer. |
| @@ -350,7 +335,7 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost, |
| void OnSwappedOut(); |
| // The current state of this RFH. |
|
Charlie Reis
2016/04/04 17:16:36
This comment needs to be updated to say precisely
nasko
2016/04/08 17:42:07
Done.
|
| - RenderFrameHostImplState rfh_state() const { return rfh_state_; } |
| + bool is_active() { return !is_waiting_for_swapout_ack_; } |
| // Sends the given navigation message. Use this rather than sending it |
| // yourself since this does the internal bookkeeping described below. This |
| @@ -659,9 +644,9 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost, |
| // Registers Mojo services that this frame host makes available. |
| void RegisterMojoServices(); |
| - // Updates the state of this RenderFrameHost and clears any waiting state |
| - // that is no longer relevant. |
| - void SetState(RenderFrameHostImplState rfh_state); |
| + // Resets any waiting state of this RenderFrameHost that is no longer |
| + // relevant. |
| + void ResetWaitingState(); |
| // Returns whether the given URL is allowed to commit in the current process. |
| // This is a more conservative check than RenderProcessHost::FilterURL, since |
| @@ -797,8 +782,9 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost, |
| int routing_id_; |
| - // The current state of this RenderFrameHost. |
| - RenderFrameHostImplState rfh_state_; |
| + // Boolean indicating whether this RenderFrameHost is being actively used or |
| + // is waiting for FrameHostMsg_SwapOut_ACK and pending deletion. |
|
Charlie Reis
2016/04/04 17:16:36
nit: and thus pending deletion.
nasko
2016/04/08 17:42:07
Done.
|
| + bool is_waiting_for_swapout_ack_; |
| // Tracks whether the RenderFrame for this RenderFrameHost has been created in |
| // the renderer process. Currently only used for subframes. |