| 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 }, | |
| 196 }; | 195 }; |
| 197 | 196 |
| 198 scoped_ptr<content::ZygoteForkDelegate> zygote_fork_delegate; | 197 scoped_ptr<content::ZygoteForkDelegate> zygote_fork_delegate; |
| 199 if (delegate) zygote_fork_delegate.reset(delegate->ZygoteStarting()); | 198 if (delegate) zygote_fork_delegate.reset(delegate->ZygoteStarting()); |
| 200 | 199 |
| 201 // This function call can return multiple times, once per fork(). | 200 // This function call can return multiple times, once per fork(). |
| 202 if (!ZygoteMain(main_function_params, zygote_fork_delegate.get())) | 201 if (!ZygoteMain(main_function_params, zygote_fork_delegate.get())) |
| 203 return 1; | 202 return 1; |
| 204 | 203 |
| 205 if (delegate) delegate->ZygoteForked(); | 204 if (delegate) delegate->ZygoteForked(); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 _CrtDumpMemoryLeaks(); | 460 _CrtDumpMemoryLeaks(); |
| 462 #endif // _CRTDBG_MAP_ALLOC | 461 #endif // _CRTDBG_MAP_ALLOC |
| 463 | 462 |
| 464 _Module.Term(); | 463 _Module.Term(); |
| 465 #endif // OS_WIN | 464 #endif // OS_WIN |
| 466 | 465 |
| 467 return exit_code; | 466 return exit_code; |
| 468 } | 467 } |
| 469 | 468 |
| 470 } // namespace content | 469 } // namespace content |
| OLD | NEW |