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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 12319035: Avoid creating an extra RVH for a tab's opener when one is pending. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch Created 7 years, 10 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/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 a11aa65fcf580ffea9ad443f3fc6250cfdb5f1dc..948058a4782d8428786d5954634e05323b3df0ec 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3420,11 +3420,15 @@ int WebContentsImpl::CreateOpenerRenderViews(SiteInstance* instance) {
if (opener_)
opener_route_id = opener_->CreateOpenerRenderViews(instance);
- // If any of the renderers for this WebContents has the same SiteInstance,
- // use it.
+ // If any of the renderers (current, pending, or swapped out) for this
+ // WebContents has the same SiteInstance, use it.
if (render_manager_.current_host()->GetSiteInstance() == instance)
return render_manager_.current_host()->GetRoutingID();
+ if (render_manager_.pending_render_view_host() &&
+ render_manager_.pending_render_view_host()->GetSiteInstance() == instance)
+ return render_manager_.pending_render_view_host()->GetRoutingID();
+
RenderViewHostImpl* rvh = render_manager_.GetSwappedOutRenderViewHost(
instance);
if (rvh)
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698