Chromium Code Reviews| Index: content/browser/site_instance_impl.h |
| diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h |
| index 81967cfffa12d827d3e8c35687ee63d9c6ac4fed..7b7944457b890ad93dce457d3736c5d6d23c490e 100644 |
| --- a/content/browser/site_instance_impl.h |
| +++ b/content/browser/site_instance_impl.h |
| @@ -44,6 +44,8 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, |
| size_t GetRelatedActiveContentsCount() override; |
| bool RequiresDedicatedProcess() override; |
| + SiteInstance* GetRelatedSiteInstanceForThirdPartySubframes(const GURL& url); |
|
Charlie Reis
2016/03/18 21:15:13
Maybe drop "Related" and |url|?
|
| + |
| // Set the web site that this SiteInstance is rendering pages for. |
| // This includes the scheme and registered domain, but not the port. If the |
| // URL does not have a valid registered domain, then the full hostname is |
| @@ -88,6 +90,8 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, |
| void AddObserver(Observer* observer); |
| void RemoveObserver(Observer* observer); |
| + bool is_for_third_party_subframes() { return is_for_third_party_subframes_; } |
| + |
| // Sets the global factory used to create new RenderProcessHosts. It may be |
| // NULL, in which case the default RenderProcessHost will be created (this is |
| // the behavior if you don't call this function). The factory must be set |
| @@ -125,6 +129,12 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, |
| // instead. |
| explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); |
| + // Only BrowsingInstance should call this. |
| + void set_is_for_third_party_subframes() { |
| + CHECK(!HasSite()); |
| + is_for_third_party_subframes_ = true; |
| + } |
| + |
| private: |
| // RenderProcessHostObserver implementation. |
| void RenderProcessHostDestroyed(RenderProcessHost* host) override; |
| @@ -146,7 +156,7 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, |
| int32_t id_; |
| // The number of active frames in this SiteInstance. |
| - size_t active_frame_count_; |
| + size_t active_frame_count_ = 0; |
| // BrowsingInstance to which this SiteInstance belongs. |
| scoped_refptr<BrowsingInstance> browsing_instance_; |
| @@ -155,13 +165,14 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, |
| // This pointer will only change once the RenderProcessHost is destructed. It |
| // will still remain the same even if the process crashes, since in that |
| // scenario the RenderProcessHost remains the same. |
| - RenderProcessHost* process_; |
| + RenderProcessHost* process_ = nullptr; |
| // The web site that this SiteInstance is rendering pages for. |
| GURL site_; |
| // Whether SetSite has been called. |
| - bool has_site_; |
| + bool has_site_ = false; |
| + bool is_for_third_party_subframes_ = false; |
| base::ObserverList<Observer, true> observers_; |