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 #include "content/browser/renderer_host/render_process_host.h" | 5 #include "content/browser/renderer_host/render_process_host.h" |
6 | 6 |
7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "chrome/common/child_process_info.h" | |
10 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
11 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
12 #include "content/browser/browser_thread.h" | 11 #include "content/browser/browser_thread.h" |
13 #include "content/browser/child_process_security_policy.h" | 12 #include "content/browser/child_process_security_policy.h" |
| 13 #include "content/common/child_process_info.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 size_t max_renderer_count_override = 0; | 17 size_t max_renderer_count_override = 0; |
18 | 18 |
19 size_t GetMaxRendererProcessCount() { | 19 size_t GetMaxRendererProcessCount() { |
20 if (max_renderer_count_override) | 20 if (max_renderer_count_override) |
21 return max_renderer_count_override; | 21 return max_renderer_count_override; |
22 | 22 |
23 // Defines the maximum number of renderer processes according to the | 23 // Defines the maximum number of renderer processes according to the |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 // Now pick a random suitable renderer, if we have any. | 198 // Now pick a random suitable renderer, if we have any. |
199 if (!suitable_renderers.empty()) { | 199 if (!suitable_renderers.empty()) { |
200 int suitable_count = static_cast<int>(suitable_renderers.size()); | 200 int suitable_count = static_cast<int>(suitable_renderers.size()); |
201 int random_index = base::RandInt(0, suitable_count - 1); | 201 int random_index = base::RandInt(0, suitable_count - 1); |
202 return suitable_renderers[random_index]; | 202 return suitable_renderers[random_index]; |
203 } | 203 } |
204 | 204 |
205 return NULL; | 205 return NULL; |
206 } | 206 } |
OLD | NEW |