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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 9264049: Allow SiteInstance for about:blank in new tab to be reused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix spacing. Created 8 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/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 3d952f96d195328f1eab9883a2d61ed3291ff828..a8c4bbe8771702bdb474d856f84948afe9391770 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -1751,9 +1751,13 @@ void TabContents::DidNavigate(RenderViewHost* rvh,
if (content::PageTransitionIsMainFrame(params.transition))
render_manager_.DidNavigateMainFrame(rvh);
- // Update the site of the SiteInstance if it doesn't have one yet.
- if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite())
+ // Update the site of the SiteInstance if it doesn't have one yet, unless
+ // this is for about:blank. In that case, the SiteInstance can still be
+ // considered unused until a navigation to a real page.
+ if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() &&
+ params.url != GURL(chrome::kAboutBlankURL)) {
static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url);
+ }
// Need to update MIME type here because it's referred to in
// UpdateNavigationCommands() called by RendererDidNavigate() to
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | content/browser/tab_contents/tab_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698