| Index: content/browser/frame_host/render_frame_host_impl.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
| index 5878180ae16a4662195f58f2e417b14557f21ec0..27580e1f9f7a517e9cc820f879ca6ca9bab136cc 100644
|
| --- a/content/browser/frame_host/render_frame_host_impl.cc
|
| +++ b/content/browser/frame_host/render_frame_host_impl.cc
|
| @@ -143,6 +143,9 @@ RenderFrameHostImpl::RenderFrameHostImpl(SiteInstance* site_instance,
|
| routing_id_(routing_id),
|
| render_frame_created_(false),
|
| navigations_suspended_(false),
|
| + has_beforeunload_handlers_(false),
|
| + has_unload_handlers_(false),
|
| + override_sudden_termination_status_(false),
|
| is_waiting_for_beforeunload_ack_(false),
|
| unload_ack_is_for_cross_site_transition_(false),
|
| accessibility_reset_token_(0),
|
| @@ -341,6 +344,10 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted,
|
| OnDocumentOnLoadCompleted)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK)
|
| + IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnloadHandlersPresent,
|
| + OnBeforeUnloadHandlersPresent)
|
| + IPC_MESSAGE_HANDLER(FrameHostMsg_UnloadHandlersPresent,
|
| + OnUnloadHandlersPresent)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse,
|
| @@ -991,6 +998,11 @@ bool RenderFrameHostImpl::IsWaitingForUnloadACK() const {
|
| rfh_state_ == STATE_PENDING_SWAP_OUT;
|
| }
|
|
|
| +bool RenderFrameHostImpl::SuddenTerminationAllowed() const {
|
| + return override_sudden_termination_status_ ||
|
| + (!has_beforeunload_handlers_ && !has_unload_handlers_);
|
| +}
|
| +
|
| void RenderFrameHostImpl::OnSwapOutACK() {
|
| OnSwappedOut();
|
| }
|
| @@ -1255,6 +1267,14 @@ void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
|
| render_view_host_->WasResized();
|
| }
|
|
|
| +void RenderFrameHostImpl::OnBeforeUnloadHandlersPresent(bool present) {
|
| + has_beforeunload_handlers_ = present;
|
| +}
|
| +
|
| +void RenderFrameHostImpl::OnUnloadHandlersPresent(bool present) {
|
| + has_unload_handlers_ = present;
|
| +}
|
| +
|
| #if defined(OS_MACOSX) || defined(OS_ANDROID)
|
| void RenderFrameHostImpl::OnShowPopup(
|
| const FrameHostMsg_ShowPopup_Params& params) {
|
|
|