| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 05dafcd5a03c47149959973c9ea7ad5ec9ee9b18..fbd9e5a7883018462ebfb65610139cc2bcb2527b 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -2386,6 +2386,16 @@ void WebContentsImpl::RequestTransferURL(
|
| }
|
| }
|
|
|
| +void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) {
|
| + // Tell the active RenderViewHost to run unload handlers and close, as long
|
| + // as the request came from a RenderViewHost in the same BrowsingInstance.
|
| + // In most cases, we receive this from a swapped out RenderViewHost.
|
| + // It is possible to receive it from one that has just been swapped in,
|
| + // in which case we might as well deliver the message anyway.
|
| + if (rvh->GetSiteInstance()->IsRelatedSiteInstance(GetSiteInstance()))
|
| + GetRenderViewHost()->ClosePage();
|
| +}
|
| +
|
| void WebContentsImpl::RunJavaScriptMessage(
|
| RenderViewHost* rvh,
|
| const string16& message,
|
|
|