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/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 #include <string.h> | 81 #include <string.h> |
82 #include "ui/base/x/x11_util.h" | 82 #include "ui/base/x/x11_util.h" |
83 #endif | 83 #endif |
84 | 84 |
85 #if defined(USE_LINUX_BREAKPAD) | 85 #if defined(USE_LINUX_BREAKPAD) |
86 #include "chrome/app/breakpad_linux.h" | 86 #include "chrome/app/breakpad_linux.h" |
87 #endif | 87 #endif |
88 | 88 |
89 base::LazyInstance<chrome::ChromeContentBrowserClient> | 89 base::LazyInstance<chrome::ChromeContentBrowserClient> |
90 g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; | 90 g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; |
| 91 // TODO(scottmg): http://crbug.com/237249 This will have to be split out into |
| 92 // browser and child parts. |
| 93 #if !defined(CHROME_SPLIT_DLL) |
91 base::LazyInstance<chrome::ChromeContentRendererClient> | 94 base::LazyInstance<chrome::ChromeContentRendererClient> |
92 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; | 95 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; |
93 base::LazyInstance<chrome::ChromeContentUtilityClient> | 96 base::LazyInstance<chrome::ChromeContentUtilityClient> |
94 g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER; | 97 g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER; |
95 base::LazyInstance<chrome::ChromeContentPluginClient> | 98 base::LazyInstance<chrome::ChromeContentPluginClient> |
96 g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER; | 99 g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER; |
| 100 #endif |
97 | 101 |
98 extern int NaClMain(const content::MainFunctionParams&); | 102 extern int NaClMain(const content::MainFunctionParams&); |
99 extern int ServiceProcessMain(const content::MainFunctionParams&); | 103 extern int ServiceProcessMain(const content::MainFunctionParams&); |
100 | 104 |
101 namespace { | 105 namespace { |
102 | 106 |
103 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
104 const wchar_t kProfilingDll[] = L"memory_watcher.dll"; | 108 const wchar_t kProfilingDll[] = L"memory_watcher.dll"; |
105 | 109 |
106 // Load the memory profiling DLL. All it needs to be activated | 110 // Load the memory profiling DLL. All it needs to be activated |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 const content::MainFunctionParams& main_function_params) { | 628 const content::MainFunctionParams& main_function_params) { |
625 // ANDROID doesn't support "service", so no ServiceProcessMain, and arraysize | 629 // ANDROID doesn't support "service", so no ServiceProcessMain, and arraysize |
626 // doesn't support empty array. So we comment out the block for Android. | 630 // doesn't support empty array. So we comment out the block for Android. |
627 #if !defined(OS_ANDROID) | 631 #if !defined(OS_ANDROID) |
628 static const MainFunction kMainFunctions[] = { | 632 static const MainFunction kMainFunctions[] = { |
629 { switches::kServiceProcess, ServiceProcessMain }, | 633 { switches::kServiceProcess, ServiceProcessMain }, |
630 #if defined(OS_MACOSX) | 634 #if defined(OS_MACOSX) |
631 { switches::kRelauncherProcess, | 635 { switches::kRelauncherProcess, |
632 mac_relauncher::internal::RelauncherMain }, | 636 mac_relauncher::internal::RelauncherMain }, |
633 #endif | 637 #endif |
634 #if !defined(DISABLE_NACL) | 638 // TODO(scottmg): http://crbug.com/237249 NaCl -> child. |
| 639 #if !defined(DISABLE_NACL) && !defined(CHROME_SPLIT_DLL) |
635 { switches::kNaClLoaderProcess, NaClMain }, | 640 { switches::kNaClLoaderProcess, NaClMain }, |
636 #endif // DISABLE_NACL | 641 #endif // DISABLE_NACL |
637 }; | 642 }; |
638 | 643 |
639 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { | 644 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { |
640 if (process_type == kMainFunctions[i].name) | 645 if (process_type == kMainFunctions[i].name) |
641 return kMainFunctions[i].function(main_function_params); | 646 return kMainFunctions[i].function(main_function_params); |
642 } | 647 } |
643 #endif | 648 #endif |
644 | 649 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 } | 703 } |
699 | 704 |
700 #endif // OS_MACOSX | 705 #endif // OS_MACOSX |
701 | 706 |
702 content::ContentBrowserClient* | 707 content::ContentBrowserClient* |
703 ChromeMainDelegate::CreateContentBrowserClient() { | 708 ChromeMainDelegate::CreateContentBrowserClient() { |
704 return &g_chrome_content_browser_client.Get(); | 709 return &g_chrome_content_browser_client.Get(); |
705 } | 710 } |
706 | 711 |
707 content::ContentPluginClient* ChromeMainDelegate::CreateContentPluginClient() { | 712 content::ContentPluginClient* ChromeMainDelegate::CreateContentPluginClient() { |
| 713 // TODO(scottmg): http://crbug.com/237249 This will have to be split out into |
| 714 // browser and child parts. |
| 715 #if defined(CHROME_SPLIT_DLL) |
| 716 return NULL; |
| 717 #else |
708 return &g_chrome_content_plugin_client.Get(); | 718 return &g_chrome_content_plugin_client.Get(); |
| 719 #endif |
709 } | 720 } |
710 | 721 |
711 content::ContentRendererClient* | 722 content::ContentRendererClient* |
712 ChromeMainDelegate::CreateContentRendererClient() { | 723 ChromeMainDelegate::CreateContentRendererClient() { |
| 724 // TODO(scottmg): http://crbug.com/237249 This will have to be split out into |
| 725 // browser and child parts. |
| 726 #if defined(CHROME_SPLIT_DLL) |
| 727 return NULL; |
| 728 #else |
713 return &g_chrome_content_renderer_client.Get(); | 729 return &g_chrome_content_renderer_client.Get(); |
| 730 #endif |
714 } | 731 } |
715 | 732 |
716 content::ContentUtilityClient* | 733 content::ContentUtilityClient* |
717 ChromeMainDelegate::CreateContentUtilityClient() { | 734 ChromeMainDelegate::CreateContentUtilityClient() { |
| 735 // TODO(scottmg): http://crbug.com/237249 This will have to be split out into |
| 736 // browser and child parts. |
| 737 #if defined(CHROME_SPLIT_DLL) |
| 738 return NULL; |
| 739 #else |
718 return &g_chrome_content_utility_client.Get(); | 740 return &g_chrome_content_utility_client.Get(); |
| 741 #endif |
719 } | 742 } |
OLD | NEW |