| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
| 6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
| 7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
| 8 // abstraction. | 8 // abstraction. |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #include "tools/memory_watcher/memory_watcher.h" | 73 #include "tools/memory_watcher/memory_watcher.h" |
| 74 #endif | 74 #endif |
| 75 #if defined(OS_MACOSX) | 75 #if defined(OS_MACOSX) |
| 76 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" | 76 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 extern int BrowserMain(const MainFunctionParams&); | 79 extern int BrowserMain(const MainFunctionParams&); |
| 80 extern int RendererMain(const MainFunctionParams&); | 80 extern int RendererMain(const MainFunctionParams&); |
| 81 extern int PluginMain(const MainFunctionParams&); | 81 extern int PluginMain(const MainFunctionParams&); |
| 82 extern int WorkerMain(const MainFunctionParams&); | 82 extern int WorkerMain(const MainFunctionParams&); |
| 83 extern int NaClMain(const MainFunctionParams&); |
| 83 extern int UtilityMain(const MainFunctionParams&); | 84 extern int UtilityMain(const MainFunctionParams&); |
| 84 extern int ProfileImportMain(const MainFunctionParams&); | 85 extern int ProfileImportMain(const MainFunctionParams&); |
| 85 extern int ZygoteMain(const MainFunctionParams&); | 86 extern int ZygoteMain(const MainFunctionParams&); |
| 86 | 87 |
| 87 #if defined(OS_WIN) | 88 #if defined(OS_WIN) |
| 88 // TODO(erikkay): isn't this already defined somewhere? | 89 // TODO(erikkay): isn't this already defined somewhere? |
| 89 #define DLLEXPORT __declspec(dllexport) | 90 #define DLLEXPORT __declspec(dllexport) |
| 90 | 91 |
| 91 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 92 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
| 92 extern "C" { | 93 extern "C" { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } else if (process_type == switches::kProfileImportProcess) { | 557 } else if (process_type == switches::kProfileImportProcess) { |
| 557 #if defined (OS_MACOSX) | 558 #if defined (OS_MACOSX) |
| 558 rv = ProfileImportMain(main_params); | 559 rv = ProfileImportMain(main_params); |
| 559 #else | 560 #else |
| 560 // TODO(port): Use OOP profile import - http://crbug.com/22142 . | 561 // TODO(port): Use OOP profile import - http://crbug.com/22142 . |
| 561 NOTIMPLEMENTED(); | 562 NOTIMPLEMENTED(); |
| 562 rv = -1; | 563 rv = -1; |
| 563 #endif | 564 #endif |
| 564 } else if (process_type == switches::kWorkerProcess) { | 565 } else if (process_type == switches::kWorkerProcess) { |
| 565 rv = WorkerMain(main_params); | 566 rv = WorkerMain(main_params); |
| 567 } else if (process_type == switches::kNaClProcess) { |
| 568 rv = NaClMain(main_params); |
| 566 } else if (process_type == switches::kZygoteProcess) { | 569 } else if (process_type == switches::kZygoteProcess) { |
| 567 #if defined(OS_LINUX) | 570 #if defined(OS_LINUX) |
| 568 if (ZygoteMain(main_params)) { | 571 if (ZygoteMain(main_params)) { |
| 569 // Zygote::HandleForkRequest may have reallocated the command | 572 // Zygote::HandleForkRequest may have reallocated the command |
| 570 // line so update it here with the new version. | 573 // line so update it here with the new version. |
| 571 const CommandLine& parsed_command_line = | 574 const CommandLine& parsed_command_line = |
| 572 *CommandLine::ForCurrentProcess(); | 575 *CommandLine::ForCurrentProcess(); |
| 573 MainFunctionParams main_params(parsed_command_line, sandbox_wrapper, | 576 MainFunctionParams main_params(parsed_command_line, sandbox_wrapper, |
| 574 &autorelease_pool); | 577 &autorelease_pool); |
| 575 rv = RendererMain(main_params); | 578 rv = RendererMain(main_params); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 | 619 |
| 617 logging::CleanupChromeLogging(); | 620 logging::CleanupChromeLogging(); |
| 618 | 621 |
| 619 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 622 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 620 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 623 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 621 DestructCrashReporter(); | 624 DestructCrashReporter(); |
| 622 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 625 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 623 | 626 |
| 624 return rv; | 627 return rv; |
| 625 } | 628 } |
| OLD | NEW |