OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_MACOSX) | 5 #if defined(OS_MACOSX) |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 #endif // OS_MACOSX | 8 #endif // OS_MACOSX |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/i18n/rtl.h" |
12 #include "base/mac/scoped_nsautorelease_pool.h" | 13 #include "base/mac/scoped_nsautorelease_pool.h" |
13 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
14 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
15 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
16 #include "base/metrics/stats_counters.h" | 17 #include "base/metrics/stats_counters.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "base/process_util.h" | 19 #include "base/process_util.h" |
19 #include "base/string_util.h" | 20 #include "base/string_util.h" |
20 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
21 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
22 #include "chrome/common/chrome_counters.h" | 23 #include "chrome/common/chrome_counters.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/gfx_resource_provider.h" | 25 #include "chrome/common/gfx_resource_provider.h" |
25 #include "chrome/common/hi_res_timer_manager.h" | 26 #include "chrome/common/hi_res_timer_manager.h" |
26 #include "chrome/common/logging_chrome.h" | 27 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/main_function_params.h" | 28 #include "chrome/common/main_function_params.h" |
28 #include "chrome/common/net/net_resource_provider.h" | 29 #include "chrome/common/net/net_resource_provider.h" |
29 #include "chrome/common/pepper_plugin_registry.h" | 30 #include "chrome/common/pepper_plugin_registry.h" |
30 #include "chrome/renderer/renderer_main_platform_delegate.h" | 31 #include "chrome/renderer/renderer_main_platform_delegate.h" |
31 #include "chrome/renderer/render_process_impl.h" | 32 #include "chrome/renderer/render_process_impl.h" |
32 #include "chrome/renderer/render_thread.h" | 33 #include "chrome/renderer/render_thread.h" |
33 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
34 #include "net/base/net_module.h" | 35 #include "net/base/net_module.h" |
35 #include "ui/base/system_monitor/system_monitor.h" | 36 #include "ui/base/system_monitor/system_monitor.h" |
| 37 #include "ui/base/ui_base_switches.h" |
36 #include "ui/gfx/gfx_module.h" | 38 #include "ui/gfx/gfx_module.h" |
37 | 39 |
38 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
39 #include "base/eintr_wrapper.h" | 41 #include "base/eintr_wrapper.h" |
40 #include "chrome/app/breakpad_mac.h" | 42 #include "chrome/app/breakpad_mac.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
42 #endif // OS_MACOSX | 44 #endif // OS_MACOSX |
43 | 45 |
44 #if defined(USE_LINUX_BREAKPAD) | 46 #if defined(USE_LINUX_BREAKPAD) |
45 #include "chrome/app/breakpad_linux.h" | 47 #include "chrome/app/breakpad_linux.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 memset(&action, 0, sizeof(action)); | 210 memset(&action, 0, sizeof(action)); |
209 action.sa_handler = SIGTERMHandler; | 211 action.sa_handler = SIGTERMHandler; |
210 CHECK(sigaction(SIGTERM, &action, NULL) == 0); | 212 CHECK(sigaction(SIGTERM, &action, NULL) == 0); |
211 #endif // OS_MACOSX | 213 #endif // OS_MACOSX |
212 | 214 |
213 #if defined(USE_LINUX_BREAKPAD) | 215 #if defined(USE_LINUX_BREAKPAD) |
214 // Needs to be called after we have chrome::DIR_USER_DATA. | 216 // Needs to be called after we have chrome::DIR_USER_DATA. |
215 InitCrashReporter(); | 217 InitCrashReporter(); |
216 #endif | 218 #endif |
217 | 219 |
| 220 #if defined(OS_CHROMEOS) |
| 221 // As Zygote process starts up earlier than browser process gets its own |
| 222 // locale (at login time for Chrome OS), we have to set the ICU default |
| 223 // locale for renderer process here. |
| 224 // ICU locale will be used for fallback font selection etc. |
| 225 if (parsed_command_line.HasSwitch(switches::kLang)) { |
| 226 const std::string locale = |
| 227 parsed_command_line.GetSwitchValueASCII(switches::kLang); |
| 228 base::i18n::SetICUDefaultLocale(locale); |
| 229 } |
| 230 #endif |
| 231 |
218 // Configure modules that need access to resources. | 232 // Configure modules that need access to resources. |
219 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 233 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
220 gfx::GfxModule::SetResourceProvider(chrome::GfxResourceProvider); | 234 gfx::GfxModule::SetResourceProvider(chrome::GfxResourceProvider); |
221 | 235 |
222 // This function allows pausing execution using the --renderer-startup-dialog | 236 // This function allows pausing execution using the --renderer-startup-dialog |
223 // flag allowing us to attach a debugger. | 237 // flag allowing us to attach a debugger. |
224 // Do not move this function down since that would mean we can't easily debug | 238 // Do not move this function down since that would mean we can't easily debug |
225 // whatever occurs before it. | 239 // whatever occurs before it. |
226 HandleRendererErrorTestParameters(parsed_command_line); | 240 HandleRendererErrorTestParameters(parsed_command_line); |
227 | 241 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 pool->Recycle(); | 312 pool->Recycle(); |
299 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 313 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
300 MessageLoop::current()->Run(); | 314 MessageLoop::current()->Run(); |
301 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 315 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
302 } | 316 } |
303 } | 317 } |
304 platform.PlatformUninitialize(); | 318 platform.PlatformUninitialize(); |
305 TRACE_EVENT_END("RendererMain", 0, ""); | 319 TRACE_EVENT_END("RendererMain", 0, ""); |
306 return 0; | 320 return 0; |
307 } | 321 } |
OLD | NEW |