Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: content/public/browser/render_process_host.h

Issue 9328011: Adding a command line flag to specify renderer process limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding unit test for the command line parameter Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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();
237
238 private:
239 // Stores the maximum number of renderer processes the content module can
240 // create.
241 static size_t max_renderer_count_override_;
jam 2012/02/07 20:27:29 for the content api we avoid putting statics in th
nasko 2012/02/07 21:29:50 Done.
231 }; 242 };
232 243
233 } // namespace content. 244 } // namespace content.
234 245
235 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 246 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
236 247
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698