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" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // TODO(markus): Check if it is OK to unconditionally move this | 205 // TODO(markus): Check if it is OK to unconditionally move this |
206 // instruction down. | 206 // instruction down. |
207 RenderProcessImpl render_process; | 207 RenderProcessImpl render_process; |
208 new RenderThreadImpl(); | 208 new RenderThreadImpl(); |
209 #endif | 209 #endif |
210 bool run_loop = true; | 210 bool run_loop = true; |
211 if (!no_sandbox) { | 211 if (!no_sandbox) { |
212 run_loop = platform.EnableSandbox(); | 212 run_loop = platform.EnableSandbox(); |
213 } else { | 213 } else { |
214 LOG(ERROR) << "Running without renderer sandbox"; | 214 LOG(ERROR) << "Running without renderer sandbox"; |
| 215 #ifndef NDEBUG |
| 216 // For convenience, we print the stack trace for crashes. We can't get |
| 217 // symbols when the sandbox is enabled, so only try when the sandbox is |
| 218 // disabled. |
| 219 base::EnableInProcessStackDumping(); |
| 220 #endif |
215 } | 221 } |
216 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 222 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
217 RenderProcessImpl render_process; | 223 RenderProcessImpl render_process; |
218 new RenderThreadImpl(); | 224 new RenderThreadImpl(); |
219 #endif | 225 #endif |
220 | 226 |
221 platform.RunSandboxTests(); | 227 platform.RunSandboxTests(); |
222 | 228 |
223 startup_timer.Stop(); // End of Startup Time Measurement. | 229 startup_timer.Stop(); // End of Startup Time Measurement. |
224 | 230 |
225 if (run_loop) { | 231 if (run_loop) { |
226 #if defined(OS_MACOSX) | 232 #if defined(OS_MACOSX) |
227 if (pool) | 233 if (pool) |
228 pool->Recycle(); | 234 pool->Recycle(); |
229 #endif | 235 #endif |
230 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 236 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
231 MessageLoop::current()->Run(); | 237 MessageLoop::current()->Run(); |
232 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 238 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
233 } | 239 } |
234 } | 240 } |
235 platform.PlatformUninitialize(); | 241 platform.PlatformUninitialize(); |
236 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 242 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
237 return 0; | 243 return 0; |
238 } | 244 } |
OLD | NEW |