OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/renderer_host/render_process_host.h" | 9 #include "content/browser/renderer_host/render_process_host.h" |
10 #include "content/common/notification_observer.h" | 10 #include "content/common/notification_observer.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // BrowsingInstance, creating a new SiteInstance if necessary. This ensures | 98 // BrowsingInstance, creating a new SiteInstance if necessary. This ensures |
99 // that a BrowsingInstance only has one SiteInstance per site, so that pages | 99 // that a BrowsingInstance only has one SiteInstance per site, so that pages |
100 // in a BrowsingInstance have the ability to script each other. Callers | 100 // in a BrowsingInstance have the ability to script each other. Callers |
101 // should ensure that this SiteInstance becomes ref counted, by storing it in | 101 // should ensure that this SiteInstance becomes ref counted, by storing it in |
102 // a scoped_refptr. (By having this method, we can hide the BrowsingInstance | 102 // a scoped_refptr. (By having this method, we can hide the BrowsingInstance |
103 // class from the rest of the codebase.) | 103 // class from the rest of the codebase.) |
104 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as | 104 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as |
105 // Darin suggests. | 105 // Darin suggests. |
106 SiteInstance* GetRelatedSiteInstance(const GURL& url); | 106 SiteInstance* GetRelatedSiteInstance(const GURL& url); |
107 | 107 |
| 108 // Returns whether this SiteInstance has a process that is the wrong type for |
| 109 // the given URL. If so, the browser should force a process swap when |
| 110 // navigating to the URL. |
| 111 bool HasWrongProcessForURL(const GURL& url) const; |
| 112 |
108 // Factory method to create a new SiteInstance. This will create a new | 113 // Factory method to create a new SiteInstance. This will create a new |
109 // new BrowsingInstance, so it should only be used when creating a new tab | 114 // new BrowsingInstance, so it should only be used when creating a new tab |
110 // from scratch (or similar circumstances). Callers should ensure that | 115 // from scratch (or similar circumstances). Callers should ensure that |
111 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. | 116 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. |
112 // | 117 // |
113 // The render process host factory may be NULL. See SiteInstance constructor. | 118 // The render process host factory may be NULL. See SiteInstance constructor. |
114 // | 119 // |
115 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as | 120 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as |
116 // Darin suggests. | 121 // Darin suggests. |
117 static SiteInstance* CreateSiteInstance(Profile* profile); | 122 static SiteInstance* CreateSiteInstance(Profile* profile); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // The web site that this SiteInstance is rendering pages for. | 199 // The web site that this SiteInstance is rendering pages for. |
195 GURL site_; | 200 GURL site_; |
196 | 201 |
197 // Whether SetSite has been called. | 202 // Whether SetSite has been called. |
198 bool has_site_; | 203 bool has_site_; |
199 | 204 |
200 DISALLOW_COPY_AND_ASSIGN(SiteInstance); | 205 DISALLOW_COPY_AND_ASSIGN(SiteInstance); |
201 }; | 206 }; |
202 | 207 |
203 #endif // CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ | 208 #endif // CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
OLD | NEW |