| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "tools/memory_watcher/memory_watcher.h" | 74 #include "tools/memory_watcher/memory_watcher.h" |
| 75 #endif | 75 #endif |
| 76 #if defined(OS_MACOSX) | 76 #if defined(OS_MACOSX) |
| 77 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" | 77 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
| 78 #endif | 78 #endif |
| 79 | 79 |
| 80 extern int BrowserMain(const MainFunctionParams&); | 80 extern int BrowserMain(const MainFunctionParams&); |
| 81 extern int RendererMain(const MainFunctionParams&); | 81 extern int RendererMain(const MainFunctionParams&); |
| 82 extern int PluginMain(const MainFunctionParams&); | 82 extern int PluginMain(const MainFunctionParams&); |
| 83 extern int WorkerMain(const MainFunctionParams&); | 83 extern int WorkerMain(const MainFunctionParams&); |
| 84 extern int NaClMain(const MainFunctionParams&); | |
| 85 extern int UtilityMain(const MainFunctionParams&); | 84 extern int UtilityMain(const MainFunctionParams&); |
| 86 extern int ProfileImportMain(const MainFunctionParams&); | 85 extern int ProfileImportMain(const MainFunctionParams&); |
| 87 extern int ZygoteMain(const MainFunctionParams&); | 86 extern int ZygoteMain(const MainFunctionParams&); |
| 88 | 87 |
| 89 #if defined(OS_WIN) | 88 #if defined(OS_WIN) |
| 90 // TODO(erikkay): isn't this already defined somewhere? | 89 // TODO(erikkay): isn't this already defined somewhere? |
| 91 #define DLLEXPORT __declspec(dllexport) | 90 #define DLLEXPORT __declspec(dllexport) |
| 92 | 91 |
| 93 // 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. |
| 94 extern "C" { | 93 extern "C" { |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } else if (process_type == switches::kProfileImportProcess) { | 572 } else if (process_type == switches::kProfileImportProcess) { |
| 574 #if defined (OS_MACOSX) | 573 #if defined (OS_MACOSX) |
| 575 rv = ProfileImportMain(main_params); | 574 rv = ProfileImportMain(main_params); |
| 576 #else | 575 #else |
| 577 // TODO(port): Use OOP profile import - http://crbug.com/22142 . | 576 // TODO(port): Use OOP profile import - http://crbug.com/22142 . |
| 578 NOTIMPLEMENTED(); | 577 NOTIMPLEMENTED(); |
| 579 rv = -1; | 578 rv = -1; |
| 580 #endif | 579 #endif |
| 581 } else if (process_type == switches::kWorkerProcess) { | 580 } else if (process_type == switches::kWorkerProcess) { |
| 582 rv = WorkerMain(main_params); | 581 rv = WorkerMain(main_params); |
| 583 } else if (process_type == switches::kNaClProcess) { | |
| 584 rv = NaClMain(main_params); | |
| 585 } else if (process_type == switches::kZygoteProcess) { | 582 } else if (process_type == switches::kZygoteProcess) { |
| 586 #if defined(OS_LINUX) | 583 #if defined(OS_LINUX) |
| 587 if (ZygoteMain(main_params)) { | 584 if (ZygoteMain(main_params)) { |
| 588 // Zygote::HandleForkRequest may have reallocated the command | 585 // Zygote::HandleForkRequest may have reallocated the command |
| 589 // line so update it here with the new version. | 586 // line so update it here with the new version. |
| 590 const CommandLine& parsed_command_line = | 587 const CommandLine& parsed_command_line = |
| 591 *CommandLine::ForCurrentProcess(); | 588 *CommandLine::ForCurrentProcess(); |
| 592 MainFunctionParams main_params(parsed_command_line, sandbox_wrapper, | 589 MainFunctionParams main_params(parsed_command_line, sandbox_wrapper, |
| 593 &autorelease_pool); | 590 &autorelease_pool); |
| 594 rv = RendererMain(main_params); | 591 rv = RendererMain(main_params); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 632 |
| 636 logging::CleanupChromeLogging(); | 633 logging::CleanupChromeLogging(); |
| 637 | 634 |
| 638 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 635 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 639 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 636 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 640 DestructCrashReporter(); | 637 DestructCrashReporter(); |
| 641 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 638 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 642 | 639 |
| 643 return rv; | 640 return rv; |
| 644 } | 641 } |
| OLD | NEW |