Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index 0822e9c863a16ed9a6e85fa956c73c957d96ae87..e41aeff8d9299523b5460b75579f5bd45e36072c 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -1028,6 +1028,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params) |
| media_player_delegate_(NULL), |
| is_using_lofi_(false), |
| is_pasting_(false), |
| + suppress_dialogs_until_swap_out_(false), |
| blame_context_(nullptr), |
| weak_factory_(this) { |
| std::pair<RoutingIDFrameMap::iterator, bool> result = |
| @@ -1443,6 +1444,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { |
| IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
| IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
| IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| + IPC_MESSAGE_HANDLER(FrameMsg_SuppressDialogsUntilSwapOut, |
| + OnSuppressDialogsUntilSwapOut) |
| #if defined(OS_ANDROID) |
| IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
| OnActivateNearestFindResult) |
| @@ -1575,9 +1578,7 @@ void RenderFrameImpl::OnSwapOut( |
| } |
| // It is now safe to show modal dialogs again. |
| - // TODO(creis): Deal with modal dialogs from subframes. |
| - if (is_main_frame_) |
| - render_view_->suppress_dialogs_until_swap_out_ = false; |
| + suppress_dialogs_until_swap_out_ = false; |
|
nasko
2016/04/04 22:00:16
Is it safe? This RenderFrame is about to be booted
Avi (use Gerrit)
2016/04/05 01:31:18
This particular switch is to make sure that a fram
Avi (use Gerrit)
2016/04/06 22:20:43
Is being swapped out a guarantee that the frame is
|
| Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); |
| @@ -2150,7 +2151,7 @@ bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, |
| base::string16* result) { |
| // Don't allow further dialogs if we are waiting to swap out, since the |
| // PageGroupLoadDeferrer in our stack prevents it. |
| - if (render_view()->suppress_dialogs_until_swap_out_) |
| + if (suppress_dialogs_until_swap_out_) |
| return false; |
| bool success = false; |
| @@ -3619,7 +3620,7 @@ bool RenderFrameImpl::runModalPromptDialog( |
| bool RenderFrameImpl::runModalBeforeUnloadDialog(bool is_reload) { |
| // Don't allow further dialogs if we are waiting to swap out, since the |
| // PageGroupLoadDeferrer in our stack prevents it. |
| - if (render_view()->suppress_dialogs_until_swap_out_) |
| + if (suppress_dialogs_until_swap_out_) |
| return false; |
| bool success = false; |
| @@ -5132,6 +5133,11 @@ void RenderFrameImpl::OnEnableViewSourceMode() { |
| frame_->enableViewSourceMode(true); |
| } |
| +void RenderFrameImpl::OnSuppressDialogsUntilSwapOut() { |
| + // Don't show any more dialogs until we finish OnSwapOut. |
| + suppress_dialogs_until_swap_out_ = true; |
| +} |
| + |
| #if defined(OS_ANDROID) |
| void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
| float x, |