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

Unified Diff: content/browser/site_instance_impl.cc

Issue 701953006: PlzNavigate: Speculatively spawns a renderer process for navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments, added simple test, other minor changes. Created 6 years, 1 month 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/site_instance_impl.cc
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index f1555dc1af8f627c7eb50d811a3ae445adec9678..d9069548b379896267977d569ec1a89bb73b5013 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -141,6 +141,7 @@ void SiteInstanceImpl::SetSite(const GURL& url) {
// be fixed, but until then, we should still not set the site of a
// SiteInstance more than once.
DCHECK(!has_site_);
+ DCHECK(!browsing_instance_->HasSiteInstance(url));
// Remember that this SiteInstance has been used to load a URL, even if the
// URL is invalid.
@@ -181,6 +182,10 @@ SiteInstance* SiteInstanceImpl::GetRelatedSiteInstance(const GURL& url) {
return browsing_instance_->GetSiteInstanceForURL(url);
}
+SiteInstance* SiteInstanceImpl::GetRelatedEmptySiteInstance() {
+ return new SiteInstanceImpl(browsing_instance_.get());
+}
+
bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) {
return browsing_instance_.get() == static_cast<const SiteInstanceImpl*>(
instance)->browsing_instance_.get();

Powered by Google App Engine
This is Rietveld 408576698