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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 // Returns true if this SiteInstance is used as the default SiteInstance for | 133 // Returns true if this SiteInstance is used as the default SiteInstance for |
134 // cross-site subframes. This only returns true if "top document isolation" is | 134 // cross-site subframes. This only returns true if "top document isolation" is |
135 // used. | 135 // used. |
136 virtual bool IsDefaultSubframeSiteInstance() const = 0; | 136 virtual bool IsDefaultSubframeSiteInstance() const = 0; |
137 | 137 |
138 // Factory method to create a new SiteInstance. This will create a new | 138 // Factory method to create a new SiteInstance. This will create a new |
139 // new BrowsingInstance, so it should only be used when creating a new tab | 139 // new BrowsingInstance, so it should only be used when creating a new tab |
140 // from scratch (or similar circumstances). | 140 // from scratch (or similar circumstances). |
141 // | 141 // |
142 // The render process host factory may be nullptr. See SiteInstance | 142 // The render process host factory may be nullptr. See SiteInstance |
143 // constructor. | 143 // constructor. |child_process_param_id| is an opaque id used passed to |
144 // launch child processes. | |
144 static scoped_refptr<SiteInstance> Create( | 145 static scoped_refptr<SiteInstance> Create( |
145 content::BrowserContext* browser_context); | 146 content::BrowserContext* browser_context, |
147 int child_process_param_id = 0); | |
boliu
2017/02/23 00:51:30
I was wary to include child_process_launcher here
| |
146 | 148 |
147 // Factory method to get the appropriate SiteInstance for the given URL, in | 149 // Factory method to get the appropriate SiteInstance for the given URL, in |
148 // a new BrowsingInstance. Use this instead of Create when you know the URL, | 150 // a new BrowsingInstance. Use this instead of Create when you know the URL, |
149 // since it allows special site grouping rules to be applied (for example, | 151 // since it allows special site grouping rules to be applied (for example, |
150 // to group chrome-ui pages into the same instance). | 152 // to group chrome-ui pages into the same instance). Note |
153 // |child_process_param_id| is not here purely because no caller uses it. | |
151 static scoped_refptr<SiteInstance> CreateForURL( | 154 static scoped_refptr<SiteInstance> CreateForURL( |
152 content::BrowserContext* browser_context, | 155 content::BrowserContext* browser_context, |
153 const GURL& url); | 156 const GURL& url); |
154 | 157 |
155 // Return whether both URLs are part of the same web site, for the purpose of | 158 // Return whether both URLs are part of the same web site, for the purpose of |
156 // assigning them to processes accordingly. The decision is currently based | 159 // assigning them to processes accordingly. The decision is currently based |
157 // on the registered domain of the URLs (google.com, bbc.co.uk), as well as | 160 // on the registered domain of the URLs (google.com, bbc.co.uk), as well as |
158 // the scheme (https, http). This ensures that two pages will be in | 161 // the scheme (https, http). This ensures that two pages will be in |
159 // the same process if they can communicate with other via JavaScript. | 162 // the same process if they can communicate with other via JavaScript. |
160 // (e.g., docs.google.com and mail.google.com have DOM access to each other | 163 // (e.g., docs.google.com and mail.google.com have DOM access to each other |
(...skipping 11 matching lines...) Expand all Loading... | |
172 protected: | 175 protected: |
173 friend class base::RefCounted<SiteInstance>; | 176 friend class base::RefCounted<SiteInstance>; |
174 | 177 |
175 SiteInstance() {} | 178 SiteInstance() {} |
176 virtual ~SiteInstance() {} | 179 virtual ~SiteInstance() {} |
177 }; | 180 }; |
178 | 181 |
179 } // namespace content. | 182 } // namespace content. |
180 | 183 |
181 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ | 184 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ |
OLD | NEW |