| 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/mac/scoped_nsautorelease_pool.h" | 12 #include "base/mac/scoped_nsautorelease_pool.h" |
| 13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/metrics/stats_counters.h" | 16 #include "base/metrics/stats_counters.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
| 21 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
| 22 #include "chrome/common/chrome_counters.h" | 22 #include "chrome/common/chrome_counters.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/gfx_resource_provider.h" |
| 24 #include "chrome/common/hi_res_timer_manager.h" | 25 #include "chrome/common/hi_res_timer_manager.h" |
| 25 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
| 26 #include "chrome/common/main_function_params.h" | 27 #include "chrome/common/main_function_params.h" |
| 27 #include "chrome/common/net/net_resource_provider.h" | 28 #include "chrome/common/net/net_resource_provider.h" |
| 28 #include "chrome/common/pepper_plugin_registry.h" | 29 #include "chrome/common/pepper_plugin_registry.h" |
| 29 #include "chrome/renderer/renderer_main_platform_delegate.h" | 30 #include "chrome/renderer/renderer_main_platform_delegate.h" |
| 30 #include "chrome/renderer/render_process_impl.h" | 31 #include "chrome/renderer/render_process_impl.h" |
| 31 #include "chrome/renderer/render_thread.h" | 32 #include "chrome/renderer/render_thread.h" |
| 33 #include "gfx/gfx_module.h" |
| 32 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
| 33 #include "net/base/net_module.h" | 35 #include "net/base/net_module.h" |
| 34 #include "ui/base/system_monitor/system_monitor.h" | 36 #include "ui/base/system_monitor/system_monitor.h" |
| 35 | 37 |
| 36 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
| 37 #include "base/eintr_wrapper.h" | 39 #include "base/eintr_wrapper.h" |
| 38 #include "chrome/app/breakpad_mac.h" | 40 #include "chrome/app/breakpad_mac.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 40 #endif // OS_MACOSX | 42 #endif // OS_MACOSX |
| 41 | 43 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 memset(&action, 0, sizeof(action)); | 208 memset(&action, 0, sizeof(action)); |
| 207 action.sa_handler = SIGTERMHandler; | 209 action.sa_handler = SIGTERMHandler; |
| 208 CHECK(sigaction(SIGTERM, &action, NULL) == 0); | 210 CHECK(sigaction(SIGTERM, &action, NULL) == 0); |
| 209 #endif // OS_MACOSX | 211 #endif // OS_MACOSX |
| 210 | 212 |
| 211 #if defined(USE_LINUX_BREAKPAD) | 213 #if defined(USE_LINUX_BREAKPAD) |
| 212 // Needs to be called after we have chrome::DIR_USER_DATA. | 214 // Needs to be called after we have chrome::DIR_USER_DATA. |
| 213 InitCrashReporter(); | 215 InitCrashReporter(); |
| 214 #endif | 216 #endif |
| 215 | 217 |
| 216 // Configure the network module so it has access to resources. | 218 // Configure modules that need access to resources. |
| 217 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 219 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
| 220 gfx::GfxModule::SetResourceProvider(chrome::GfxResourceProvider); |
| 218 | 221 |
| 219 // This function allows pausing execution using the --renderer-startup-dialog | 222 // This function allows pausing execution using the --renderer-startup-dialog |
| 220 // flag allowing us to attach a debugger. | 223 // flag allowing us to attach a debugger. |
| 221 // Do not move this function down since that would mean we can't easily debug | 224 // Do not move this function down since that would mean we can't easily debug |
| 222 // whatever occurs before it. | 225 // whatever occurs before it. |
| 223 HandleRendererErrorTestParameters(parsed_command_line); | 226 HandleRendererErrorTestParameters(parsed_command_line); |
| 224 | 227 |
| 225 RendererMainPlatformDelegate platform(parameters); | 228 RendererMainPlatformDelegate platform(parameters); |
| 226 | 229 |
| 227 base::StatsScope<base::StatsCounterTimer> | 230 base::StatsScope<base::StatsCounterTimer> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 pool->Recycle(); | 298 pool->Recycle(); |
| 296 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); | 299 TRACE_EVENT_BEGIN("RendererMain.START_MSG_LOOP", 0, 0); |
| 297 MessageLoop::current()->Run(); | 300 MessageLoop::current()->Run(); |
| 298 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); | 301 TRACE_EVENT_END("RendererMain.START_MSG_LOOP", 0, 0); |
| 299 } | 302 } |
| 300 } | 303 } |
| 301 platform.PlatformUninitialize(); | 304 platform.PlatformUninitialize(); |
| 302 TRACE_EVENT_END("RendererMain", 0, ""); | 305 TRACE_EVENT_END("RendererMain", 0, ""); |
| 303 return 0; | 306 return 0; |
| 304 } | 307 } |
| OLD | NEW |