Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1612)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1931793002: Stop using nested message loop for alert() and other JS dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comment Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 20615babaf1bc6449bf695955c1f49e538b32456..710d990b495bdfad32e389485729dce8ac5d032b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2123,18 +2123,6 @@ void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) {
surroundingText.endOffsetInTextContent()));
}
-bool RenderFrameImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
- // Before Blink asks us to show an alert (etc.), it takes care of doing the
- // equivalent of WebView::willEnterModalLoop. In this case it is particularly
- // important that we do not call willEnterModalLoop as that would defer
- // resource loads for the dialog itself.
- if (RenderThreadImpl::current()) // Will be NULL during unit tests.
- RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop();
-
- message->EnableMessagePumping(); // Runs a nested message loop.
- return Send(message);
-}
-
bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
const base::string16& message,
const base::string16& default_value,
@@ -2150,7 +2138,7 @@ bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
if (!result)
result = &result_temp;
- SendAndRunNestedMessageLoop(new FrameHostMsg_RunJavaScriptMessage(
+ Send(new FrameHostMsg_RunJavaScriptMessage(
routing_id_, message, default_value, frame_url, type, &success, result));
return success;
}
@@ -3629,7 +3617,7 @@ bool RenderFrameImpl::runModalBeforeUnloadDialog(bool is_reload) {
// This is an ignored return value, but is included so we can accept the same
// response as RunJavaScriptMessage.
base::string16 ignored_result;
- SendAndRunNestedMessageLoop(new FrameHostMsg_RunBeforeUnloadConfirm(
+ Send(new FrameHostMsg_RunBeforeUnloadConfirm(
routing_id_, frame_->document().url(), is_reload, &success,
&ignored_result));
return success;

Powered by Google App Engine
This is Rietveld 408576698