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_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // list. | 149 // list. |
150 static void RegisterHost(int host_id, RenderProcessHost* host); | 150 static void RegisterHost(int host_id, RenderProcessHost* host); |
151 static void UnregisterHost(int host_id); | 151 static void UnregisterHost(int host_id); |
152 | 152 |
153 // Returns true if |host| is suitable for launching a new view with |site_url| | 153 // Returns true if |host| is suitable for launching a new view with |site_url| |
154 // in the given |browser_context|. | 154 // in the given |browser_context|. |
155 static bool IsSuitableHost(RenderProcessHost* host, | 155 static bool IsSuitableHost(RenderProcessHost* host, |
156 BrowserContext* browser_context, | 156 BrowserContext* browser_context, |
157 const GURL& site_url); | 157 const GURL& site_url); |
158 | 158 |
159 // Returns whether the process-per-site model is in use (globally or just for | |
160 // the current site), in which case we should ensure there is only one | |
161 // RenderProcessHost per site for the entire browser context. | |
162 static bool ShouldUseProcessPerSite(BrowserContext* browser_context, | |
163 const GURL& url); | |
164 | |
165 // Returns an existing RenderProcessHost for |url| in |browser_context|, | 159 // Returns an existing RenderProcessHost for |url| in |browser_context|, |
166 // if one exists. Otherwise a new RenderProcessHost should be created and | 160 // if one exists. Otherwise a new RenderProcessHost should be created and |
167 // registered using RegisterProcessHostForSite(). | 161 // registered using RegisterProcessHostForSite(). |
168 // This should only be used for process-per-site mode, which can be enabled | 162 // This should only be used for process-per-site mode, which can be enabled |
169 // globally with a command line flag or per-site, as determined by | 163 // globally with a command line flag or per-site, as determined by |
170 // SiteInstanceImpl::ShouldUseProcessPerSite. | 164 // SiteInstanceImpl::ShouldUseProcessPerSite. |
171 static RenderProcessHost* GetProcessHostForSite( | 165 static RenderProcessHost* GetProcessHostForSite( |
172 BrowserContext* browser_context, | 166 BrowserContext* browser_context, |
173 const GURL& url); | 167 const GURL& url); |
174 | 168 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // Prevents the class from being added as a GpuDataManagerImpl observer more | 328 // Prevents the class from being added as a GpuDataManagerImpl observer more |
335 // than once. | 329 // than once. |
336 bool gpu_observer_registered_; | 330 bool gpu_observer_registered_; |
337 | 331 |
338 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 332 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
339 }; | 333 }; |
340 | 334 |
341 } // namespace content | 335 } // namespace content |
342 | 336 |
343 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 337 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |