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_BROWSER_SITE_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Get the effective URL for the given actual URL. This allows the | 114 // Get the effective URL for the given actual URL. This allows the |
115 // ContentBrowserClient to override the SiteInstance's site for certain URLs. | 115 // ContentBrowserClient to override the SiteInstance's site for certain URLs. |
116 // For example, Chrome uses this to replace hosted app URLs with extension | 116 // For example, Chrome uses this to replace hosted app URLs with extension |
117 // hosts. | 117 // hosts. |
118 // Only public so that we can make a consistent process swap decision in | 118 // Only public so that we can make a consistent process swap decision in |
119 // RenderFrameHostManager. | 119 // RenderFrameHostManager. |
120 static GURL GetEffectiveURL(BrowserContext* browser_context, | 120 static GURL GetEffectiveURL(BrowserContext* browser_context, |
121 const GURL& url); | 121 const GURL& url); |
122 | 122 |
123 // Returns true if pages loaded from |effective_url| ought to be handled only | 123 // Returns true if pages loaded from |url| ought to be handled only by a |
124 // by a renderer process isolated from other sites. If --site-per-process is | 124 // renderer process isolated from other sites. If --site-per-process is on the |
125 // on the command line, this is true for all sites. In other site isolation | 125 // command line, this is true for all sites. In other site isolation modes, |
126 // modes, only a subset of sites will require dedicated processes. | 126 // only a subset of sites will require dedicated processes. |
127 // | |
128 // |effective_url| must be an effective URL. | |
129 static bool DoesSiteRequireDedicatedProcess(BrowserContext* browser_context, | 127 static bool DoesSiteRequireDedicatedProcess(BrowserContext* browser_context, |
130 const GURL& effective_url); | 128 const GURL& url); |
131 | 129 |
132 private: | 130 private: |
133 friend class BrowsingInstance; | 131 friend class BrowsingInstance; |
134 friend class SiteInstanceTestBrowserClient; | 132 friend class SiteInstanceTestBrowserClient; |
135 | 133 |
136 // Create a new SiteInstance. Only BrowsingInstance should call this | 134 // Create a new SiteInstance. Only BrowsingInstance should call this |
137 // directly; clients should use Create() or GetRelatedSiteInstance() instead. | 135 // directly; clients should use Create() or GetRelatedSiteInstance() instead. |
138 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); | 136 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); |
139 | 137 |
140 ~SiteInstanceImpl() override; | 138 ~SiteInstanceImpl() override; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 bool is_default_subframe_site_instance_; | 184 bool is_default_subframe_site_instance_; |
187 | 185 |
188 base::ObserverList<Observer, true> observers_; | 186 base::ObserverList<Observer, true> observers_; |
189 | 187 |
190 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); | 188 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); |
191 }; | 189 }; |
192 | 190 |
193 } // namespace content | 191 } // namespace content |
194 | 192 |
195 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 193 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
OLD | NEW |