Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/app/chrome_main.cc

Issue 6995095: Move UtilityProcessHost to content and move the message sending/dispatching to the clients. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "chrome/app/chrome_main.h"
6 6
7 #include "app/app_paths.h" 7 #include "app/app_paths.h"
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/debugger.h" 10 #include "base/debug/debugger.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/common/chrome_content_client.h" 28 #include "chrome/common/chrome_content_client.h"
29 #include "chrome/common/chrome_content_plugin_client.h" 29 #include "chrome/common/chrome_content_plugin_client.h"
30 #include "chrome/common/chrome_paths.h" 30 #include "chrome/common/chrome_paths.h"
31 #include "chrome/common/chrome_paths_internal.h" 31 #include "chrome/common/chrome_paths_internal.h"
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/chrome_version_info.h" 33 #include "chrome/common/chrome_version_info.h"
34 #include "chrome/common/logging_chrome.h" 34 #include "chrome/common/logging_chrome.h"
35 #include "chrome/common/profiling.h" 35 #include "chrome/common/profiling.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "chrome/renderer/chrome_content_renderer_client.h" 37 #include "chrome/renderer/chrome_content_renderer_client.h"
38 #include "chrome/utility/chrome_content_utility_client.h"
38 #include "content/browser/renderer_host/render_process_host.h" 39 #include "content/browser/renderer_host/render_process_host.h"
39 #include "content/common/content_client.h" 40 #include "content/common/content_client.h"
40 #include "content/common/content_counters.h" 41 #include "content/common/content_counters.h"
41 #include "content/common/content_paths.h" 42 #include "content/common/content_paths.h"
42 #include "content/common/main_function_params.h" 43 #include "content/common/main_function_params.h"
43 #include "content/common/sandbox_init_wrapper.h" 44 #include "content/common/sandbox_init_wrapper.h"
44 #include "content/common/set_process_title.h" 45 #include "content/common/set_process_title.h"
45 #include "ipc/ipc_switches.h" 46 #include "ipc/ipc_switches.h"
46 #include "ui/base/resource/resource_bundle.h" 47 #include "ui/base/resource/resource_bundle.h"
47 #include "ui/base/ui_base_paths.h" 48 #include "ui/base/ui_base_paths.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #include <gtk/gtk.h> 85 #include <gtk/gtk.h>
85 #include <stdlib.h> 86 #include <stdlib.h>
86 #include <string.h> 87 #include <string.h>
87 #include "ui/base/x/x11_util.h" 88 #include "ui/base/x/x11_util.h"
88 #endif 89 #endif
89 90
90 #if defined(USE_LINUX_BREAKPAD) 91 #if defined(USE_LINUX_BREAKPAD)
91 #include "chrome/app/breakpad_linux.h" 92 #include "chrome/app/breakpad_linux.h"
92 #endif 93 #endif
93 94
94 #if !defined(NACL_WIN64) // We don't build the renderer code on win nacl64. 95 #if !defined(NACL_WIN64) // We don't build the this code on win nacl64.
95 base::LazyInstance<chrome::ChromeContentRendererClient> 96 base::LazyInstance<chrome::ChromeContentRendererClient>
96 g_chrome_content_renderer_client(base::LINKER_INITIALIZED); 97 g_chrome_content_renderer_client(base::LINKER_INITIALIZED);
98 base::LazyInstance<chrome::ChromeContentUtilityClient>
99 g_chrome_content_utility_client(base::LINKER_INITIALIZED);
97 #endif // NACL_WIN64 100 #endif // NACL_WIN64
98 101
99 base::LazyInstance<chrome::ChromeContentPluginClient> 102 base::LazyInstance<chrome::ChromeContentPluginClient>
100 g_chrome_content_plugin_client(base::LINKER_INITIALIZED); 103 g_chrome_content_plugin_client(base::LINKER_INITIALIZED);
101 104
102 extern int BrowserMain(const MainFunctionParams&); 105 extern int BrowserMain(const MainFunctionParams&);
103 extern int RendererMain(const MainFunctionParams&); 106 extern int RendererMain(const MainFunctionParams&);
104 extern int GpuMain(const MainFunctionParams&); 107 extern int GpuMain(const MainFunctionParams&);
105 extern int PluginMain(const MainFunctionParams&); 108 extern int PluginMain(const MainFunctionParams&);
106 extern int PpapiPluginMain(const MainFunctionParams&); 109 extern int PpapiPluginMain(const MainFunctionParams&);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 #endif 237 #endif
235 } 238 }
236 239
237 void InitializeChromeContentClient(const std::string& process_type) { 240 void InitializeChromeContentClient(const std::string& process_type) {
238 if (process_type == switches::kPluginProcess) { 241 if (process_type == switches::kPluginProcess) {
239 content::GetContentClient()->set_plugin( 242 content::GetContentClient()->set_plugin(
240 &g_chrome_content_plugin_client.Get()); 243 &g_chrome_content_plugin_client.Get());
241 } else if (process_type == switches::kRendererProcess || 244 } else if (process_type == switches::kRendererProcess ||
242 process_type == switches::kExtensionProcess) { 245 process_type == switches::kExtensionProcess) {
243 InitializeChromeContentRendererClient(); 246 InitializeChromeContentRendererClient();
247 } else if (process_type == switches::kUtilityProcess) {
248 #if !defined(NACL_WIN64) // We don't build this code on win nacl64.
249 content::GetContentClient()->set_utility(
250 &g_chrome_content_utility_client.Get());
251 #endif
244 } 252 }
245 } 253 }
246 254
247 void CommonSubprocessInit(const std::string& process_type) { 255 void CommonSubprocessInit(const std::string& process_type) {
248 #if defined(OS_WIN) 256 #if defined(OS_WIN)
249 // HACK: Let Windows know that we have started. This is needed to suppress 257 // HACK: Let Windows know that we have started. This is needed to suppress
250 // the IDC_APPSTARTING cursor from being displayed for a prolonged period 258 // the IDC_APPSTARTING cursor from being displayed for a prolonged period
251 // while a subprocess is starting. 259 // while a subprocess is starting.
252 PostThreadMessage(GetCurrentThreadId(), WM_NULL, 0, 0); 260 PostThreadMessage(GetCurrentThreadId(), WM_NULL, 0, 0);
253 MSG msg; 261 MSG msg;
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 833
826 if (SubprocessNeedsResourceBundle(process_type)) 834 if (SubprocessNeedsResourceBundle(process_type))
827 ResourceBundle::CleanupSharedInstance(); 835 ResourceBundle::CleanupSharedInstance();
828 836
829 logging::CleanupChromeLogging(); 837 logging::CleanupChromeLogging();
830 838
831 chrome_main::LowLevelShutdown(); 839 chrome_main::LowLevelShutdown();
832 840
833 return exit_code; 841 return exit_code;
834 } 842 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698