Chromium Code Reviews| Index: content/browser/renderer_host/render_view_host.h |
| diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h |
| index 14ecddd9690574b71c9ad090309be1df4303c86e..9673c604f24457ab37d685987b447cdd11bfa448 100644 |
| --- a/content/browser/renderer_host/render_view_host.h |
| +++ b/content/browser/renderer_host/render_view_host.h |
| @@ -160,27 +160,43 @@ class RenderViewHost : public RenderWidgetHost { |
| // are_navigations_suspended() first. |
| void SetNavigationsSuspended(bool suspend); |
| + // Clears any suspended navigation state after a cross-site navigation is |
| + // canceled or suspended. This is important if we later return to this |
| + // RenderViewHost. |
| + void CancelSuspendedNavigations(); |
| + |
| + // Whether this RenderViewHost has been swapped out to be displayed by a |
| + // different process. |
| + bool is_swapped_out() const { return is_swapped_out_; } |
| + |
| // Causes the renderer to invoke the onbeforeunload event handler. The |
| - // result will be returned via ViewMsg_ShouldClose. See also ClosePage which |
| - // will fire the PageUnload event. |
| + // result will be returned via ViewMsg_ShouldClose. See also ClosePage and |
| + // SwapOut, which fire the PageUnload event. |
| // |
| // Set bool for_cross_site_transition when this close is just for the current |
| // RenderView in the case of a cross-site transition. False means we're |
| // closing the entire tab. |
| void FirePageBeforeUnload(bool for_cross_site_transition); |
| + // Tells the renderer that this RenderView is being swapped out for one in a |
| + // different renderer process. The renderer should preserve the Frame object |
| + // until it exits (when it has no more active RenderViews). |
| + // |
| + // Please see ViewMsg_SwapOut_Params in view_messages.h for a description |
| + // of the parameters. |
| + void SwapOut(int new_render_process_host_id, int new_request_id); |
| + |
| + // Called by ResourceDispatcherHost after the SwapOutACK is received. |
| + void OnSwapOutACK(); |
| + |
| + // Called to notify the RenderWidget that it has been visibly swapped out, |
|
Matt Perry
2011/04/29 19:25:18
RenderView
Charlie Reis
2011/05/05 15:17:59
Done.
|
| + // such that it is safe for the process to exit if not otherwise in use. |
| + void WasSwappedOut(); |
|
Matt Perry
2011/04/29 19:25:18
I'm a little confused on the difference between Sw
Charlie Reis
2011/05/05 15:17:59
Done.
|
| + |
| // Causes the renderer to close the current page, including running its |
| // onunload event handler. A ClosePage_ACK message will be sent to the |
| // ResourceDispatcherHost when it is finished. |
| - // |
| - // Please see ViewMsg_ClosePage in resource_messages_internal.h for a |
| - // description of the parameters. |
| - void ClosePage(bool for_cross_site_transition, |
| - int new_render_process_host_id, |
| - int new_request_id); |
| - |
| - // Called by ResourceDispatcherHost after the ClosePageACK is received. |
| - void OnClosePageACK(bool for_cross_site_transition); |
| + void ClosePage(); |
| // Close the page ignoring whether it has unload events registers. |
| // This is called after the beforeunload and unload events have fired |
| @@ -453,6 +469,10 @@ class RenderViewHost : public RenderWidgetHost { |
| void AddObserver(RenderViewHostObserver* observer); |
| void RemoveObserver(RenderViewHostObserver* observer); |
| + // Filter out most IPC messages while swapped out, except for messages needed |
| + // to preserve consistent browser and renderer state. |
| + bool CanHandleWhileSwappedOut(const IPC::Message& msg); |
| + |
| // RenderWidgetHost protected overrides. |
| virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| bool* is_keyboard_shortcut); |
| @@ -519,6 +539,7 @@ class RenderViewHost : public RenderWidgetHost { |
| void OnUpdateInspectorSetting(const std::string& key, |
| const std::string& value); |
| void OnMsgShouldCloseACK(bool proceed); |
| + void OnMsgClosePageACK(); |
| void OnAccessibilityNotifications( |
| const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); |
| @@ -581,6 +602,10 @@ class RenderViewHost : public RenderWidgetHost { |
| // navigation occurs. |
| scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; |
| + // Whether this RenderViewHost is currently swapped out, such that the view is |
| + // being rendered by another process. |
| + bool is_swapped_out_; |
| + |
| // If we were asked to RunModal, then this will hold the reply_msg that we |
| // must return to the renderer to unblock it. |
| IPC::Message* run_modal_reply_msg_; |