| 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_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return run_renderer_in_process_; | 240 return run_renderer_in_process_; |
| 241 } | 241 } |
| 242 static void set_run_renderer_in_process(bool value) { | 242 static void set_run_renderer_in_process(bool value) { |
| 243 run_renderer_in_process_ = value; | 243 run_renderer_in_process_ = value; |
| 244 } | 244 } |
| 245 | 245 |
| 246 // Allows iteration over all the RenderProcessHosts in the browser. Note | 246 // Allows iteration over all the RenderProcessHosts in the browser. Note |
| 247 // that each host may not be active, and therefore may have NULL channels. | 247 // that each host may not be active, and therefore may have NULL channels. |
| 248 static iterator AllHostsIterator(); | 248 static iterator AllHostsIterator(); |
| 249 | 249 |
| 250 // Returns the number of active RenderProcessHosts. |
| 251 static int AllHostsCount(); |
| 252 |
| 250 // Returns the RenderProcessHost given its ID. Returns NULL if the ID does | 253 // Returns the RenderProcessHost given its ID. Returns NULL if the ID does |
| 251 // not correspond to a live RenderProcessHost. | 254 // not correspond to a live RenderProcessHost. |
| 252 static RenderProcessHost* FromID(int render_process_id); | 255 static RenderProcessHost* FromID(int render_process_id); |
| 253 | 256 |
| 254 // Returns true if the caller should attempt to use an existing | 257 // Returns true if the caller should attempt to use an existing |
| 255 // RenderProcessHost rather than creating a new one. | 258 // RenderProcessHost rather than creating a new one. |
| 256 static bool ShouldTryToUseExistingProcessHost(); | 259 static bool ShouldTryToUseExistingProcessHost(); |
| 257 | 260 |
| 258 // Get an existing RenderProcessHost associated with the given browser | 261 // Get an existing RenderProcessHost associated with the given browser |
| 259 // context, if possible. The renderer process is chosen randomly from | 262 // context, if possible. The renderer process is chosen randomly from |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // Factory object for RenderProcessHosts. Using this factory allows tests to | 328 // Factory object for RenderProcessHosts. Using this factory allows tests to |
| 326 // swap out a different one to use a TestRenderProcessHost. | 329 // swap out a different one to use a TestRenderProcessHost. |
| 327 class RenderProcessHostFactory { | 330 class RenderProcessHostFactory { |
| 328 public: | 331 public: |
| 329 virtual ~RenderProcessHostFactory() {} | 332 virtual ~RenderProcessHostFactory() {} |
| 330 virtual RenderProcessHost* CreateRenderProcessHost( | 333 virtual RenderProcessHost* CreateRenderProcessHost( |
| 331 content::BrowserContext* browser_context) const = 0; | 334 content::BrowserContext* browser_context) const = 0; |
| 332 }; | 335 }; |
| 333 | 336 |
| 334 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 337 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |