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/app/content_main.h" | 5 #include "content/app/content_main.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // On platforms that use the zygote, we have a special subset of | 185 // On platforms that use the zygote, we have a special subset of |
186 // subprocesses that are launched via the zygote. This function | 186 // subprocesses that are launched via the zygote. This function |
187 // fills in some process-launching bits around ZygoteMain(). | 187 // fills in some process-launching bits around ZygoteMain(). |
188 // Returns the exit code of the subprocess. | 188 // Returns the exit code of the subprocess. |
189 int RunZygote(const content::MainFunctionParams& main_function_params, | 189 int RunZygote(const content::MainFunctionParams& main_function_params, |
190 content::ContentMainDelegate* delegate) { | 190 content::ContentMainDelegate* delegate) { |
191 static const MainFunction kMainFunctions[] = { | 191 static const MainFunction kMainFunctions[] = { |
192 { switches::kRendererProcess, RendererMain }, | 192 { switches::kRendererProcess, RendererMain }, |
193 { switches::kWorkerProcess, WorkerMain }, | 193 { switches::kWorkerProcess, WorkerMain }, |
194 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 194 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
| 195 { switches::kUtilityProcess, UtilityMain }, |
195 }; | 196 }; |
196 | 197 |
197 scoped_ptr<content::ZygoteForkDelegate> zygote_fork_delegate; | 198 scoped_ptr<content::ZygoteForkDelegate> zygote_fork_delegate; |
198 if (delegate) zygote_fork_delegate.reset(delegate->ZygoteStarting()); | 199 if (delegate) zygote_fork_delegate.reset(delegate->ZygoteStarting()); |
199 | 200 |
200 // This function call can return multiple times, once per fork(). | 201 // This function call can return multiple times, once per fork(). |
201 if (!ZygoteMain(main_function_params, zygote_fork_delegate.get())) | 202 if (!ZygoteMain(main_function_params, zygote_fork_delegate.get())) |
202 return 1; | 203 return 1; |
203 | 204 |
204 if (delegate) delegate->ZygoteForked(); | 205 if (delegate) delegate->ZygoteForked(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 _CrtDumpMemoryLeaks(); | 461 _CrtDumpMemoryLeaks(); |
461 #endif // _CRTDBG_MAP_ALLOC | 462 #endif // _CRTDBG_MAP_ALLOC |
462 | 463 |
463 _Module.Term(); | 464 _Module.Term(); |
464 #endif // OS_WIN | 465 #endif // OS_WIN |
465 | 466 |
466 return exit_code; | 467 return exit_code; |
467 } | 468 } |
468 | 469 |
469 } // namespace content | 470 } // namespace content |
OLD | NEW |