| 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/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // zygote_main_linux.cc. However, calling multiple times from the same thread | 184 // zygote_main_linux.cc. However, calling multiple times from the same thread |
| 185 // is OK. | 185 // is OK. |
| 186 InitializeWebRtcModule(); | 186 InitializeWebRtcModule(); |
| 187 #endif | 187 #endif |
| 188 | 188 |
| 189 { | 189 { |
| 190 #if defined(OS_WIN) || defined(OS_MACOSX) | 190 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 191 // TODO(markus): Check if it is OK to unconditionally move this | 191 // TODO(markus): Check if it is OK to unconditionally move this |
| 192 // instruction down. | 192 // instruction down. |
| 193 RenderProcessImpl render_process; | 193 RenderProcessImpl render_process; |
| 194 new RenderThreadImpl(main_message_loop.Pass()); | 194 RenderThreadImpl::Create(main_message_loop.Pass()); |
| 195 #endif | 195 #endif |
| 196 bool run_loop = true; | 196 bool run_loop = true; |
| 197 if (!no_sandbox) { | 197 if (!no_sandbox) { |
| 198 run_loop = platform.EnableSandbox(); | 198 run_loop = platform.EnableSandbox(); |
| 199 } else { | 199 } else { |
| 200 LOG(ERROR) << "Running without renderer sandbox"; | 200 LOG(ERROR) << "Running without renderer sandbox"; |
| 201 #ifndef NDEBUG | 201 #ifndef NDEBUG |
| 202 // For convenience, we print the stack traces for crashes. When sandbox | 202 // For convenience, we print the stack traces for crashes. When sandbox |
| 203 // is enabled, the in-process stack dumping is enabled as part of the | 203 // is enabled, the in-process stack dumping is enabled as part of the |
| 204 // EnableSandbox() call. | 204 // EnableSandbox() call. |
| 205 base::debug::EnableInProcessStackDumping(); | 205 base::debug::EnableInProcessStackDumping(); |
| 206 #endif | 206 #endif |
| 207 } | 207 } |
| 208 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 208 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 209 RenderProcessImpl render_process; | 209 RenderProcessImpl render_process; |
| 210 new RenderThreadImpl(main_message_loop.Pass()); | 210 RenderThreadImpl::Create(main_message_loop.Pass()); |
| 211 #endif | 211 #endif |
| 212 base::HighResolutionTimerManager hi_res_timer_manager; | 212 base::HighResolutionTimerManager hi_res_timer_manager; |
| 213 | 213 |
| 214 if (run_loop) { | 214 if (run_loop) { |
| 215 #if defined(OS_MACOSX) | 215 #if defined(OS_MACOSX) |
| 216 if (pool) | 216 if (pool) |
| 217 pool->Recycle(); | 217 pool->Recycle(); |
| 218 #endif | 218 #endif |
| 219 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 219 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 220 base::MessageLoop::current()->Run(); | 220 base::MessageLoop::current()->Run(); |
| 221 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 221 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 222 } | 222 } |
| 223 #if defined(LEAK_SANITIZER) | 223 #if defined(LEAK_SANITIZER) |
| 224 // Run leak detection before RenderProcessImpl goes out of scope. This helps | 224 // Run leak detection before RenderProcessImpl goes out of scope. This helps |
| 225 // ignore shutdown-only leaks. | 225 // ignore shutdown-only leaks. |
| 226 __lsan_do_leak_check(); | 226 __lsan_do_leak_check(); |
| 227 #endif | 227 #endif |
| 228 } | 228 } |
| 229 platform.PlatformUninitialize(); | 229 platform.PlatformUninitialize(); |
| 230 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 230 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 231 return 0; | 231 return 0; |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace content | 234 } // namespace content |
| OLD | NEW |