| 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_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Get an existing RenderProcessHost associated with the given browser | 218 // Get an existing RenderProcessHost associated with the given browser |
| 219 // context, if possible. The renderer process is chosen randomly from | 219 // context, if possible. The renderer process is chosen randomly from |
| 220 // suitable renderers that share the same context and type (determined by the | 220 // suitable renderers that share the same context and type (determined by the |
| 221 // site url). | 221 // site url). |
| 222 // Returns NULL if no suitable renderer process is available, in which case | 222 // Returns NULL if no suitable renderer process is available, in which case |
| 223 // the caller is free to create a new renderer. | 223 // the caller is free to create a new renderer. |
| 224 static RenderProcessHost* GetExistingProcessHost( | 224 static RenderProcessHost* GetExistingProcessHost( |
| 225 content::BrowserContext* browser_context, const GURL& site_url); | 225 content::BrowserContext* browser_context, const GURL& site_url); |
| 226 | 226 |
| 227 // Overrides the default heuristic for limiting the max renderer process | 227 // Overrides the default heuristic for limiting the max renderer process |
| 228 // count. This is useful for unit testing process limit behaviors. | 228 // count. This is useful for unit testing process limit behaviors. It is |
| 229 // also used to allow a command line parameter to configure the max number of |
| 230 // renderer processes and should only be called once during startup. |
| 229 // A value of zero means to use the default heuristic. | 231 // A value of zero means to use the default heuristic. |
| 230 static void SetMaxRendererProcessCountForTest(size_t count); | 232 static void SetMaxRendererProcessCount(size_t count); |
| 233 |
| 234 // Returns the current max number of renderer processes used by the content |
| 235 // module. |
| 236 static size_t GetMaxRendererProcessCount(); |
| 231 }; | 237 }; |
| 232 | 238 |
| 233 } // namespace content. | 239 } // namespace content. |
| 234 | 240 |
| 235 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 241 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| 236 | 242 |
| OLD | NEW |