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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 // list. | 125 // list. |
126 static void RegisterHost(int host_id, RenderProcessHost* host); | 126 static void RegisterHost(int host_id, RenderProcessHost* host); |
127 static void UnregisterHost(int host_id); | 127 static void UnregisterHost(int host_id); |
128 | 128 |
129 // Returns true if the given host is suitable for launching a new view | 129 // Returns true if the given host is suitable for launching a new view |
130 // associated with the given browser context. | 130 // associated with the given browser context. |
131 static bool IsSuitableHost(RenderProcessHost* host, | 131 static bool IsSuitableHost(RenderProcessHost* host, |
132 BrowserContext* browser_context, | 132 BrowserContext* browser_context, |
133 const GURL& site_url); | 133 const GURL& site_url); |
134 | 134 |
135 // Returns whether the process-per-site model is in use (globally or just for | |
136 // the current site), in which case we should ensure there is only one | |
137 // RenderProcessHost per site for the entire browser context. | |
138 static bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, | |
jam
2012/06/28 21:25:05
nit: here and below, get rid of "content::" since
Charlie Reis
2012/06/28 21:30:19
Done.
| |
139 const GURL& url); | |
140 | |
141 // Returns an existing RenderProcessHost for |url| in |browser_context|, | |
142 // if one exists. Otherwise a new RenderProcessHost should be created and | |
143 // registered using RegisterProcessHostForSite(). | |
144 // This should only be used for process-per-site mode, which can be enabled | |
145 // globally with a command line flag or per-site, as determined by | |
146 // SiteInstanceImpl::ShouldUseProcessPerSite. | |
147 static RenderProcessHost* GetProcessHostForSite( | |
148 content::BrowserContext* browser_context, | |
149 const GURL& url); | |
150 | |
151 // Registers the given |process| to be used for any instance of |url| | |
152 // within |browser_context|. | |
153 // This should only be used for process-per-site mode, which can be enabled | |
154 // globally with a command line flag or per-site, as determined by | |
155 // SiteInstanceImpl::ShouldUseProcessPerSite. | |
156 static void RegisterProcessHostForSite( | |
157 content::BrowserContext* browser_context, | |
158 RenderProcessHost* process, | |
159 const GURL& url); | |
160 | |
135 protected: | 161 protected: |
136 // A proxy for our IPC::Channel that lives on the IO thread (see | 162 // A proxy for our IPC::Channel that lives on the IO thread (see |
137 // browser_process.h) | 163 // browser_process.h) |
138 scoped_ptr<IPC::ChannelProxy> channel_; | 164 scoped_ptr<IPC::ChannelProxy> channel_; |
139 | 165 |
140 // The registered render widget hosts. When this list is empty or all NULL, | 166 // The registered render widget hosts. When this list is empty or all NULL, |
141 // we should delete ourselves | 167 // we should delete ourselves |
142 IDMap<RenderWidgetHost> render_widget_hosts_; | 168 IDMap<RenderWidgetHost> render_widget_hosts_; |
143 | 169 |
144 // True if fast shutdown has been performed on this RPH. | 170 // True if fast shutdown has been performed on this RPH. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest | 296 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest |
271 // renderer. | 297 // renderer. |
272 bool is_guest_; | 298 bool is_guest_; |
273 | 299 |
274 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 300 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
275 }; | 301 }; |
276 | 302 |
277 } // namespace content | 303 } // namespace content |
278 | 304 |
279 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 305 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |