| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/hi_res_timer_manager.h" | 9 #include "base/hi_res_timer_manager.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/metrics/statistics_recorder.h" | 15 #include "base/metrics/statistics_recorder.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/system_monitor/system_monitor.h" | 20 #include "base/system_monitor/system_monitor.h" |
| 21 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
| 22 #include "base/time.h" | 22 #include "base/time.h" |
| 23 #include "content/common/pepper_plugin_registry.h" | 23 #include "content/common/pepper_plugin_registry.h" |
| 24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
| 25 #include "content/public/common/main_function_params.h" | 25 #include "content/public/common/main_function_params.h" |
| 26 #include "content/public/renderer/content_renderer_client.h" | 26 #include "content/public/renderer/content_renderer_client.h" |
| 27 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | |
| 28 #include "content/renderer/render_process_impl.h" | 27 #include "content/renderer/render_process_impl.h" |
| 29 #include "content/renderer/render_thread_impl.h" | 28 #include "content/renderer/render_thread_impl.h" |
| 30 #include "content/renderer/renderer_main_platform_delegate.h" | 29 #include "content/renderer/renderer_main_platform_delegate.h" |
| 31 #include "ui/base/ui_base_switches.h" | 30 #include "ui/base/ui_base_switches.h" |
| 32 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" | 31 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" |
| 33 | 32 |
| 34 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
| 35 #include <Carbon/Carbon.h> | 34 #include <Carbon/Carbon.h> |
| 36 #include <signal.h> | 35 #include <signal.h> |
| 37 #include <unistd.h> | 36 #include <unistd.h> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // For convenience, we print the stack trace for crashes. We can't get | 216 // For convenience, we print the stack trace for crashes. We can't get |
| 218 // symbols when the sandbox is enabled, so only try when the sandbox is | 217 // symbols when the sandbox is enabled, so only try when the sandbox is |
| 219 // disabled. | 218 // disabled. |
| 220 base::EnableInProcessStackDumping(); | 219 base::EnableInProcessStackDumping(); |
| 221 #endif | 220 #endif |
| 222 } | 221 } |
| 223 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 222 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 224 RenderProcessImpl render_process; | 223 RenderProcessImpl render_process; |
| 225 new RenderThreadImpl(); | 224 new RenderThreadImpl(); |
| 226 #endif | 225 #endif |
| 227 new content::BrowserPluginManagerImpl(); | |
| 228 | 226 |
| 229 platform.RunSandboxTests(); | 227 platform.RunSandboxTests(); |
| 230 | 228 |
| 231 startup_timer.Stop(); // End of Startup Time Measurement. | 229 startup_timer.Stop(); // End of Startup Time Measurement. |
| 232 | 230 |
| 233 if (run_loop) { | 231 if (run_loop) { |
| 234 #if defined(OS_MACOSX) | 232 #if defined(OS_MACOSX) |
| 235 if (pool) | 233 if (pool) |
| 236 pool->Recycle(); | 234 pool->Recycle(); |
| 237 #endif | 235 #endif |
| 238 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 239 MessageLoop::current()->Run(); | 237 MessageLoop::current()->Run(); |
| 240 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 238 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 241 } | 239 } |
| 242 } | 240 } |
| 243 platform.PlatformUninitialize(); | 241 platform.PlatformUninitialize(); |
| 244 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 242 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 245 return 0; | 243 return 0; |
| 246 } | 244 } |
| OLD | NEW |