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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2366693006: Don't show dialogs from swapped out frames. (Closed)
Patch Set: now thread safe Created 4 years, 3 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/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 bcfd886f3c2bc284e01c379adaaf6c68577f4916..6bd1d310395dc97fced96fd2ea22e6cd1dc9850e 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1584,6 +1584,11 @@ void RenderFrameHostImpl::OnRunJavaScriptMessage(
const GURL& frame_url,
JavaScriptMessageType type,
IPC::Message* reply_msg) {
+ if (!is_active()) {
+ JavaScriptDialogClosed(reply_msg, true, base::string16(), true);
+ return;
+ }
+
int32_t message_length = static_cast<int32_t>(message.length());
if (GetParent()) {
UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.Subframe", message_length);

Powered by Google App Engine
This is Rietveld 408576698