| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // NOTE: On linux, this call could already have been made from | 169 // NOTE: On linux, this call could already have been made from |
| 170 // zygote_main_linux.cc. However, calling multiple times from the same thread | 170 // zygote_main_linux.cc. However, calling multiple times from the same thread |
| 171 // is OK. | 171 // is OK. |
| 172 InitializeWebRtcModule(); | 172 InitializeWebRtcModule(); |
| 173 #endif | 173 #endif |
| 174 | 174 |
| 175 { | 175 { |
| 176 #if defined(OS_WIN) || defined(OS_MACOSX) | 176 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 177 // TODO(markus): Check if it is OK to unconditionally move this | 177 // TODO(markus): Check if it is OK to unconditionally move this |
| 178 // instruction down. | 178 // instruction down. |
| 179 RenderProcessImpl render_process; | 179 auto render_process = RenderProcessImpl::Create(); |
| 180 RenderThreadImpl::Create(std::move(main_message_loop), | 180 RenderThreadImpl::Create(std::move(main_message_loop), |
| 181 std::move(renderer_scheduler)); | 181 std::move(renderer_scheduler)); |
| 182 #endif | 182 #endif |
| 183 bool run_loop = true; | 183 bool run_loop = true; |
| 184 if (!no_sandbox) | 184 if (!no_sandbox) |
| 185 run_loop = platform.EnableSandbox(); | 185 run_loop = platform.EnableSandbox(); |
| 186 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 186 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 187 RenderProcessImpl render_process; | 187 auto render_process = RenderProcessImpl::Create(); |
| 188 RenderThreadImpl::Create(std::move(main_message_loop), | 188 RenderThreadImpl::Create(std::move(main_message_loop), |
| 189 std::move(renderer_scheduler)); | 189 std::move(renderer_scheduler)); |
| 190 #endif | 190 #endif |
| 191 | 191 |
| 192 base::HighResolutionTimerManager hi_res_timer_manager; | 192 base::HighResolutionTimerManager hi_res_timer_manager; |
| 193 | 193 |
| 194 if (run_loop) { | 194 if (run_loop) { |
| 195 #if defined(OS_MACOSX) | 195 #if defined(OS_MACOSX) |
| 196 if (pool) | 196 if (pool) |
| 197 pool->Recycle(); | 197 pool->Recycle(); |
| 198 #endif | 198 #endif |
| 199 TRACE_EVENT_ASYNC_BEGIN0("toplevel", "RendererMain.START_MSG_LOOP", 0); | 199 TRACE_EVENT_ASYNC_BEGIN0("toplevel", "RendererMain.START_MSG_LOOP", 0); |
| 200 base::RunLoop().Run(); | 200 base::RunLoop().Run(); |
| 201 TRACE_EVENT_ASYNC_END0("toplevel", "RendererMain.START_MSG_LOOP", 0); | 201 TRACE_EVENT_ASYNC_END0("toplevel", "RendererMain.START_MSG_LOOP", 0); |
| 202 } | 202 } |
| 203 | 203 |
| 204 #if defined(LEAK_SANITIZER) | 204 #if defined(LEAK_SANITIZER) |
| 205 // Run leak detection before RenderProcessImpl goes out of scope. This helps | 205 // Run leak detection before RenderProcessImpl goes out of scope. This helps |
| 206 // ignore shutdown-only leaks. | 206 // ignore shutdown-only leaks. |
| 207 __lsan_do_leak_check(); | 207 __lsan_do_leak_check(); |
| 208 #endif | 208 #endif |
| 209 } | 209 } |
| 210 platform.PlatformUninitialize(); | 210 platform.PlatformUninitialize(); |
| 211 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 211 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
| 212 return 0; | 212 return 0; |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace content | 215 } // namespace content |
| OLD | NEW |