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

Unified Diff: content/renderer/render_widget.cc

Issue 10344028: Support cross-process window.close() messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/public/browser/render_view_host_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 3ec18652cd251b0e357bfdcfbc14adda35d7d0e9..03eca5de14f3e7ebf6f44aec4040ede0971ce512 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1255,6 +1255,14 @@ void RenderWidget::DoDeferredClose() {
}
void RenderWidget::closeWidgetSoon() {
+ if (is_swapped_out_) {
+ // This widget is currently swapped out, and the active widget is in a
+ // different process. Have the browser route the close request to the
+ // active widget instead, so that the correct unload handlers are run.
+ Send(new ViewHostMsg_RouteCloseEvent(routing_id_));
+ return;
+ }
+
// If a page calls window.close() twice, we'll end up here twice, but that's
// OK. It is safe to send multiple Close messages.
« no previous file with comments | « content/public/browser/render_view_host_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698