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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (parsed_command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 475 if (parsed_command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
476 MessageLoop::EnableHistogrammer(true); | 476 MessageLoop::EnableHistogrammer(true); |
477 | 477 |
478 // Checks if the sandbox is enabled in this process and initializes it if this | 478 // Checks if the sandbox is enabled in this process and initializes it if this |
479 // is the case. The crash handler depends on this so it has to be done before | 479 // is the case. The crash handler depends on this so it has to be done before |
480 // its initialization. | 480 // its initialization. |
481 SandboxInitWrapper sandbox_wrapper; | 481 SandboxInitWrapper sandbox_wrapper; |
482 #if defined(OS_WIN) | 482 #if defined(OS_WIN) |
483 sandbox_wrapper.SetServices(sandbox_info); | 483 sandbox_wrapper.SetServices(sandbox_info); |
484 #endif | 484 #endif |
| 485 #if defined (OS_MACOSX) |
| 486 // On OS X the renderer sandbox needs to be initialized later in the startup |
| 487 // sequence in RendererMainPlatformDelegate::PlatformInitialize(). |
| 488 if (process_type != switches::kRendererProcess) |
| 489 sandbox_wrapper.InitializeSandbox(parsed_command_line, process_type); |
| 490 #else |
485 sandbox_wrapper.InitializeSandbox(parsed_command_line, process_type); | 491 sandbox_wrapper.InitializeSandbox(parsed_command_line, process_type); |
| 492 #endif // !OS_MACOSX |
486 | 493 |
487 #if defined(OS_WIN) | 494 #if defined(OS_WIN) |
488 _Module.Init(NULL, instance); | 495 _Module.Init(NULL, instance); |
489 #endif | 496 #endif |
490 | 497 |
491 // Notice a user data directory override if any | 498 // Notice a user data directory override if any |
492 const FilePath user_data_dir = FilePath::FromWStringHack( | 499 const FilePath user_data_dir = FilePath::FromWStringHack( |
493 parsed_command_line.GetSwitchValue(switches::kUserDataDir)); | 500 parsed_command_line.GetSwitchValue(switches::kUserDataDir)); |
494 if (!user_data_dir.empty()) | 501 if (!user_data_dir.empty()) |
495 CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); | 502 CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 647 |
641 logging::CleanupChromeLogging(); | 648 logging::CleanupChromeLogging(); |
642 | 649 |
643 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 650 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
644 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 651 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
645 DestructCrashReporter(); | 652 DestructCrashReporter(); |
646 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 653 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
647 | 654 |
648 return rv; | 655 return rv; |
649 } | 656 } |
OLD | NEW |