void WebViewHost::runModal() { if (m_shell->isDisplayingModalDialog()) { // DumpRenderTree doesn't support real modal dialogs, so a test shouldn't try to start two modal dialogs at the same time. ASSERT_NOT_REACHED(); return; } // This WebViewHost might get deleted before RunMessageLoop() returns, so keep a copy of the m_shell member variable around. ASSERT(m_shell->webViewHost() != this); TestShell* shell = m_shell; shell->setIsDisplayingModalDialog(true); bool oldState = webkit_support::MessageLoopNestableTasksAllowed(); webkit_support::MessageLoopSetNestableTasksAllowed(true); m_inModalLoop = true; webkit_support::RunMessageLoop(); webkit_support::MessageLoopSetNestableTasksAllowed(oldState); shell->setIsDisplayingModalDialog(false); }