| OLD | NEW |
| 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 #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/i18n/rtl.h" |
| 13 #include "base/mac/scoped_nsautorelease_pool.h" | 13 #include "base/mac/scoped_nsautorelease_pool.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/metrics/field_trial.h" | 15 #include "base/metrics/field_trial.h" |
| 16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/metrics/stats_counters.h" | 18 #include "base/metrics/stats_counters.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/process_util.h" | 20 #include "base/process_util.h" |
| 21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 22 #include "base/system_monitor/system_monitor.h" | |
| 23 #include "base/threading/platform_thread.h" | 22 #include "base/threading/platform_thread.h" |
| 24 #include "base/time.h" | 23 #include "base/time.h" |
| 25 #include "content/common/content_counters.h" | 24 #include "content/common/content_counters.h" |
| 26 #include "content/common/content_switches.h" | 25 #include "content/common/content_switches.h" |
| 27 #include "content/common/main_function_params.h" | 26 #include "content/common/main_function_params.h" |
| 28 #include "content/common/hi_res_timer_manager.h" | 27 #include "content/common/hi_res_timer_manager.h" |
| 29 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
| 30 #include "content/renderer/render_process_impl.h" | 29 #include "content/renderer/render_process_impl.h" |
| 31 #include "content/renderer/render_thread.h" | 30 #include "content/renderer/render_thread.h" |
| 32 #include "content/renderer/renderer_main_platform_delegate.h" | 31 #include "content/renderer/renderer_main_platform_delegate.h" |
| 32 #include "ui/base/system_monitor/system_monitor.h" |
| 33 #include "ui/base/ui_base_switches.h" | 33 #include "ui/base/ui_base_switches.h" |
| 34 | 34 |
| 35 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
| 36 #include <Carbon/Carbon.h> // TISCreateInputSourceList | 36 #include <Carbon/Carbon.h> // TISCreateInputSourceList |
| 37 | 37 |
| 38 #include "base/sys_info.h" | 38 #include "base/sys_info.h" |
| 39 #include "third_party/mach_override/mach_override.h" | 39 #include "third_party/mach_override/mach_override.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 41 #endif // OS_MACOSX | 41 #endif // OS_MACOSX |
| 42 | 42 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 #else | 169 #else |
| 170 // The main message loop of the renderer services doesn't have IO or UI tasks, | 170 // The main message loop of the renderer services doesn't have IO or UI tasks, |
| 171 // unless in-process-plugins is used. | 171 // unless in-process-plugins is used. |
| 172 MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() ? | 172 MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() ? |
| 173 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); | 173 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); |
| 174 #endif | 174 #endif |
| 175 main_message_loop.AddTaskObserver(&task_observer); | 175 main_message_loop.AddTaskObserver(&task_observer); |
| 176 | 176 |
| 177 base::PlatformThread::SetName("CrRendererMain"); | 177 base::PlatformThread::SetName("CrRendererMain"); |
| 178 | 178 |
| 179 base::SystemMonitor system_monitor; | 179 ui::SystemMonitor system_monitor; |
| 180 HighResolutionTimerManager hi_res_timer_manager; | 180 HighResolutionTimerManager hi_res_timer_manager; |
| 181 | 181 |
| 182 platform.PlatformInitialize(); | 182 platform.PlatformInitialize(); |
| 183 | 183 |
| 184 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 184 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
| 185 platform.InitSandboxTests(no_sandbox); | 185 platform.InitSandboxTests(no_sandbox); |
| 186 | 186 |
| 187 // Initialize histogram statistics gathering system. | 187 // Initialize histogram statistics gathering system. |
| 188 // Don't create StatisticsRecorder in the single process mode. | 188 // Don't create StatisticsRecorder in the single process mode. |
| 189 scoped_ptr<base::StatisticsRecorder> statistics; | 189 scoped_ptr<base::StatisticsRecorder> statistics; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 pool->Recycle(); | 233 pool->Recycle(); |
| 234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 235 MessageLoop::current()->Run(); | 235 MessageLoop::current()->Run(); |
| 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 platform.PlatformUninitialize(); | 239 platform.PlatformUninitialize(); |
| 240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 241 return 0; | 241 return 0; |
| 242 } | 242 } |
| OLD | NEW |