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

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 comments and removed unused declaration 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 61a3eb8bdd5999c0ac2d555c736e6ca97137cfe4..4f85000046bbea9eed9c41d2fed5d03fc244ee63 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2177,18 +2177,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,
@@ -2204,7 +2192,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;
}
@@ -3716,7 +3704,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;
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698