| Index: content/browser/site_instance_impl.cc
|
| diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
| index a4c886260e008f39fc30ab153d898df9fd09f2d0..94186205015aa3a4d86d68e7352f7209620d122b 100644
|
| --- a/content/browser/site_instance_impl.cc
|
| +++ b/content/browser/site_instance_impl.cc
|
| @@ -44,6 +44,7 @@ SiteInstanceImpl::~SiteInstanceImpl() {
|
| // (within the same BrowsingInstance) can safely create a new SiteInstance.
|
| if (has_site_)
|
| browsing_instance_->UnregisterSiteInstance(this);
|
| + browsing_instance_->UnregisterUsedFor(this, sites_displayed_);
|
| }
|
|
|
| scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::Create(
|
| @@ -61,6 +62,17 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForURL(
|
| return instance->GetSiteInstanceForURL(url);
|
| }
|
|
|
| +// static
|
| +scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::FindOrCreateForURL(
|
| + BrowserContext* browser_context,
|
| + const GURL& url) {
|
| + scoped_refptr<SiteInstanceImpl> instance_found =
|
| + BrowsingInstance::FindSiteInstance(browser_context, url);
|
| + if (instance_found)
|
| + return instance_found;
|
| + return CreateForURL(browser_context, url);
|
| +}
|
| +
|
| int32_t SiteInstanceImpl::GetId() {
|
| return id_;
|
| }
|
| @@ -269,6 +281,13 @@ bool SiteInstanceImpl::HasSite() const {
|
| return has_site_;
|
| }
|
|
|
| +void SiteInstanceImpl::UsedFor(const GURL& url) {
|
| + std::string site = GetSiteForURL(browsing_instance_->browser_context_, url)
|
| + .possibly_invalid_spec();
|
| + sites_displayed_.insert(site);
|
| + browsing_instance_->RegisterUsedFor(this, site);
|
| +}
|
| +
|
| bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
| return browsing_instance_->HasSiteInstance(url);
|
| }
|
|
|