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

Unified Diff: content/app/content_main_runner.cc

Issue 65193003: Clear SingleProcess and InProcessGPU logic. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Extract RegisterMainThreadFactories() from RunNamedProcessTypeMain() for readability. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/command_line_unittest.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index da27afaaf017aa36d9ca79c77b98cbf032ac72f3..d6ecb1ea08f297ae02949901b84dbc01db3ce977 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -406,6 +406,29 @@ int RunZygote(const MainFunctionParams& main_function_params,
#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
#if !defined(OS_IOS)
+static void RegisterMainThreadFactories() {
+#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
+ UtilityProcessHost::RegisterUtilityMainThreadFactory(
+ CreateInProcessUtilityThread);
+ RenderProcessHost::RegisterRendererMainThreadFactory(
+ CreateInProcessRendererThread);
+ GpuProcessHost::RegisterGpuMainThreadFactory(
+ CreateInProcessGpuThread);
+#else
+ CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kSingleProcess)) {
+ command_line.RemoveSwitch(switches::kSingleProcess);
+ LOG(ERROR) <<
+ "--single-process is not supported in chrome multiple dll browser.";
Nico 2013/11/19 00:35:16 Can't you just LOG(FATAL)?
dshwang 2013/11/19 11:12:01 piman@ mentioned in https://codereview.chromium.or
piman 2013/11/19 20:35:57 I'm ok with a LOG(FATAL) here, that explains what'
+ }
+ if (command_line.HasSwitch(switches::kInProcessGPU)) {
+ command_line.RemoveSwitch(switches::kInProcessGPU);
+ LOG(ERROR) <<
+ "--in-process-gpu is not supported in chrome multiple dll browser.";
+ }
+#endif
+}
+
// Run the FooMain() for a given process type.
// If |process_type| is empty, runs BrowserMain().
// Returns the exit code for this process.
@@ -430,14 +453,7 @@ int RunNamedProcessTypeMain(
#endif // !CHROME_MULTIPLE_DLL_BROWSER
};
-#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
- UtilityProcessHost::RegisterUtilityMainThreadFactory(
- CreateInProcessUtilityThread);
- RenderProcessHost::RegisterRendererMainThreadFactory(
- CreateInProcessRendererThread);
- GpuProcessHost::RegisterGpuMainThreadFactory(
- CreateInProcessGpuThread);
-#endif
+ RegisterMainThreadFactories();
for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
if (process_type == kMainFunctions[i].name) {
« no previous file with comments | « base/command_line_unittest.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698