| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 AdjustLinuxOOMScore(process_type); | 629 AdjustLinuxOOMScore(process_type); |
| 630 #endif | 630 #endif |
| 631 #if defined(OS_WIN) | 631 #if defined(OS_WIN) |
| 632 SuppressWindowsErrorDialogs(); | 632 SuppressWindowsErrorDialogs(); |
| 633 #endif | 633 #endif |
| 634 } | 634 } |
| 635 | 635 |
| 636 int ChromeMainDelegate::RunProcess( | 636 int ChromeMainDelegate::RunProcess( |
| 637 const std::string& process_type, | 637 const std::string& process_type, |
| 638 const content::MainFunctionParams& main_function_params) { | 638 const content::MainFunctionParams& main_function_params) { |
| 639 // ANDROID doesn't support "service", so no ServiceProcessMain, and arraysize |
| 640 // doesn't support empty array. So we comment out the block for Android. |
| 641 #if !defined(OS_ANDROID) |
| 639 static const MainFunction kMainFunctions[] = { | 642 static const MainFunction kMainFunctions[] = { |
| 640 { switches::kServiceProcess, ServiceProcessMain }, | 643 { switches::kServiceProcess, ServiceProcessMain }, |
| 641 #if defined(OS_MACOSX) | 644 #if defined(OS_MACOSX) |
| 642 { switches::kRelauncherProcess, | 645 { switches::kRelauncherProcess, |
| 643 mac_relauncher::internal::RelauncherMain }, | 646 mac_relauncher::internal::RelauncherMain }, |
| 644 #endif | 647 #endif |
| 645 #if !defined(DISABLE_NACL) | 648 #if !defined(DISABLE_NACL) |
| 646 { switches::kNaClLoaderProcess, NaClMain }, | 649 { switches::kNaClLoaderProcess, NaClMain }, |
| 647 #endif // DISABLE_NACL | 650 #endif // DISABLE_NACL |
| 648 }; | 651 }; |
| 649 | 652 |
| 650 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { | 653 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { |
| 651 if (process_type == kMainFunctions[i].name) | 654 if (process_type == kMainFunctions[i].name) |
| 652 return kMainFunctions[i].function(main_function_params); | 655 return kMainFunctions[i].function(main_function_params); |
| 653 } | 656 } |
| 657 #endif |
| 654 | 658 |
| 655 return -1; | 659 return -1; |
| 656 } | 660 } |
| 657 | 661 |
| 658 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { | 662 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { |
| 659 if (SubprocessNeedsResourceBundle(process_type)) | 663 if (SubprocessNeedsResourceBundle(process_type)) |
| 660 ResourceBundle::CleanupSharedInstance(); | 664 ResourceBundle::CleanupSharedInstance(); |
| 661 | 665 |
| 662 logging::CleanupChromeLogging(); | 666 logging::CleanupChromeLogging(); |
| 663 } | 667 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 | 720 |
| 717 content::ContentRendererClient* | 721 content::ContentRendererClient* |
| 718 ChromeMainDelegate::CreateContentRendererClient() { | 722 ChromeMainDelegate::CreateContentRendererClient() { |
| 719 return &g_chrome_content_renderer_client.Get(); | 723 return &g_chrome_content_renderer_client.Get(); |
| 720 } | 724 } |
| 721 | 725 |
| 722 content::ContentUtilityClient* | 726 content::ContentUtilityClient* |
| 723 ChromeMainDelegate::CreateContentUtilityClient() { | 727 ChromeMainDelegate::CreateContentUtilityClient() { |
| 724 return &g_chrome_content_utility_client.Get(); | 728 return &g_chrome_content_utility_client.Get(); |
| 725 } | 729 } |
| OLD | NEW |