OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // class from the rest of the codebase.) | 100 // class from the rest of the codebase.) |
101 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as | 101 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as |
102 // Darin suggests. | 102 // Darin suggests. |
103 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) = 0; | 103 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) = 0; |
104 | 104 |
105 // Returns whether the given SiteInstance is in the same BrowsingInstance as | 105 // Returns whether the given SiteInstance is in the same BrowsingInstance as |
106 // this one. If so, JavaScript interactions that are permitted across | 106 // this one. If so, JavaScript interactions that are permitted across |
107 // origins (e.g., postMessage) should be supported. | 107 // origins (e.g., postMessage) should be supported. |
108 virtual bool IsRelatedSiteInstance(const SiteInstance* instance) = 0; | 108 virtual bool IsRelatedSiteInstance(const SiteInstance* instance) = 0; |
109 | 109 |
| 110 // Returns the total active WebContents count for this SiteInstance and all |
| 111 // related SiteInstances in the same BrowsingInstance. |
| 112 virtual size_t GetRelatedActiveContentsCount() const = 0; |
| 113 |
110 // Factory method to create a new SiteInstance. This will create a new | 114 // Factory method to create a new SiteInstance. This will create a new |
111 // new BrowsingInstance, so it should only be used when creating a new tab | 115 // new BrowsingInstance, so it should only be used when creating a new tab |
112 // from scratch (or similar circumstances). Callers should ensure that | 116 // from scratch (or similar circumstances). Callers should ensure that |
113 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. | 117 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. |
114 // | 118 // |
115 // The render process host factory may be NULL. See SiteInstance constructor. | 119 // The render process host factory may be NULL. See SiteInstance constructor. |
116 // | 120 // |
117 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as | 121 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as |
118 // Darin suggests. | 122 // Darin suggests. |
119 static SiteInstance* Create(content::BrowserContext* browser_context); | 123 static SiteInstance* Create(content::BrowserContext* browser_context); |
(...skipping 22 matching lines...) Expand all Loading... |
142 protected: | 146 protected: |
143 friend class base::RefCounted<SiteInstance>; | 147 friend class base::RefCounted<SiteInstance>; |
144 | 148 |
145 SiteInstance() {} | 149 SiteInstance() {} |
146 virtual ~SiteInstance() {} | 150 virtual ~SiteInstance() {} |
147 }; | 151 }; |
148 | 152 |
149 } // namespace content. | 153 } // namespace content. |
150 | 154 |
151 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ | 155 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ |
OLD | NEW |