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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/metrics/stats_counters.h" | 13 #include "base/metrics/stats_counters.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/system_monitor/system_monitor.h" | 17 #include "base/system_monitor/system_monitor.h" |
18 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
19 #include "base/time.h" | 19 #include "base/time.h" |
20 #include "content/common/content_counters.h" | 20 #include "content/common/content_counters.h" |
21 #include "content/common/content_switches.h" | 21 #include "content/common/content_switches.h" |
22 #include "content/common/main_function_params.h" | 22 #include "content/common/main_function_params.h" |
23 #include "content/common/hi_res_timer_manager.h" | 23 #include "content/common/hi_res_timer_manager.h" |
24 #include "content/common/pepper_plugin_registry.h" | 24 #include "content/common/pepper_plugin_registry.h" |
25 #include "content/renderer/render_process_impl.h" | 25 #include "content/renderer/render_process_impl.h" |
26 #include "content/renderer/render_thread.h" | 26 #include "content/renderer/render_thread_impl.h" |
27 #include "content/renderer/renderer_main_platform_delegate.h" | 27 #include "content/renderer/renderer_main_platform_delegate.h" |
28 #include "ui/base/ui_base_switches.h" | 28 #include "ui/base/ui_base_switches.h" |
29 | 29 |
30 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
31 #include <Carbon/Carbon.h> | 31 #include <Carbon/Carbon.h> |
32 #include <signal.h> | 32 #include <signal.h> |
33 #include <unistd.h> | 33 #include <unistd.h> |
34 | 34 |
35 #include "base/mac/mac_util.h" | 35 #include "base/mac/mac_util.h" |
36 #include "third_party/mach_override/mach_override.h" | 36 #include "third_party/mach_override/mach_override.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 // Load pepper plugins before engaging the sandbox. | 199 // Load pepper plugins before engaging the sandbox. |
200 PepperPluginRegistry::GetInstance(); | 200 PepperPluginRegistry::GetInstance(); |
201 | 201 |
202 { | 202 { |
203 #if defined(OS_WIN) || defined(OS_MACOSX) | 203 #if defined(OS_WIN) || defined(OS_MACOSX) |
204 // TODO(markus): Check if it is OK to unconditionally move this | 204 // TODO(markus): Check if it is OK to unconditionally move this |
205 // instruction down. | 205 // instruction down. |
206 RenderProcessImpl render_process; | 206 RenderProcessImpl render_process; |
207 render_process.set_main_thread(new RenderThread()); | 207 render_process.set_main_thread(new RenderThreadImpl()); |
208 #endif | 208 #endif |
209 bool run_loop = true; | 209 bool run_loop = true; |
210 if (!no_sandbox) { | 210 if (!no_sandbox) { |
211 run_loop = platform.EnableSandbox(); | 211 run_loop = platform.EnableSandbox(); |
212 } else { | 212 } else { |
213 LOG(ERROR) << "Running without renderer sandbox"; | 213 LOG(ERROR) << "Running without renderer sandbox"; |
214 } | 214 } |
215 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 215 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
216 RenderProcessImpl render_process; | 216 RenderProcessImpl render_process; |
217 render_process.set_main_thread(new RenderThread()); | 217 render_process.set_main_thread(new RenderThreadImpl()); |
218 #endif | 218 #endif |
219 | 219 |
220 platform.RunSandboxTests(); | 220 platform.RunSandboxTests(); |
221 | 221 |
222 startup_timer.Stop(); // End of Startup Time Measurement. | 222 startup_timer.Stop(); // End of Startup Time Measurement. |
223 | 223 |
224 if (run_loop) { | 224 if (run_loop) { |
225 if (pool) | 225 if (pool) |
226 pool->Recycle(); | 226 pool->Recycle(); |
227 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 227 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
228 MessageLoop::current()->Run(); | 228 MessageLoop::current()->Run(); |
229 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 229 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
230 } | 230 } |
231 } | 231 } |
232 platform.PlatformUninitialize(); | 232 platform.PlatformUninitialize(); |
233 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 233 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
234 return 0; | 234 return 0; |
235 } | 235 } |
OLD | NEW |