| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // mainline routine for running as the Renderer process | 91 // mainline routine for running as the Renderer process |
| 92 int RendererMain(const MainFunctionParams& parameters) { | 92 int RendererMain(const MainFunctionParams& parameters) { |
| 93 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't | 93 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't |
| 94 // expect synchronous events around the main loop of a thread. | 94 // expect synchronous events around the main loop of a thread. |
| 95 TRACE_EVENT_ASYNC_BEGIN0("startup", "RendererMain", 0); | 95 TRACE_EVENT_ASYNC_BEGIN0("startup", "RendererMain", 0); |
| 96 | 96 |
| 97 base::trace_event::TraceLog::GetInstance()->SetProcessName("Renderer"); | 97 base::trace_event::TraceLog::GetInstance()->SetProcessName("Renderer"); |
| 98 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( | 98 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( |
| 99 kTraceEventRendererProcessSortIndex); | 99 kTraceEventRendererProcessSortIndex); |
| 100 | 100 |
| 101 #if defined(OS_WIN) && defined(__clang__) | |
| 102 // TODO(thakis): Remove this again soon, it's here to check what effect | |
| 103 // renderer startup delays have on a particular metric in the next dev | |
| 104 // channel release. | |
| 105 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); | |
| 106 #endif | |
| 107 | |
| 108 const base::CommandLine& parsed_command_line = parameters.command_line; | 101 const base::CommandLine& parsed_command_line = parameters.command_line; |
| 109 | 102 |
| 110 #if defined(OS_MACOSX) | 103 #if defined(OS_MACOSX) |
| 111 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 104 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
| 112 #endif // OS_MACOSX | 105 #endif // OS_MACOSX |
| 113 | 106 |
| 114 #if defined(OS_CHROMEOS) | 107 #if defined(OS_CHROMEOS) |
| 115 // As Zygote process starts up earlier than browser process gets its own | 108 // As Zygote process starts up earlier than browser process gets its own |
| 116 // locale (at login time for Chrome OS), we have to set the ICU default | 109 // locale (at login time for Chrome OS), we have to set the ICU default |
| 117 // locale for renderer process here. | 110 // locale for renderer process here. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // ignore shutdown-only leaks. | 225 // ignore shutdown-only leaks. |
| 233 __lsan_do_leak_check(); | 226 __lsan_do_leak_check(); |
| 234 #endif | 227 #endif |
| 235 } | 228 } |
| 236 platform.PlatformUninitialize(); | 229 platform.PlatformUninitialize(); |
| 237 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 230 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
| 238 return 0; | 231 return 0; |
| 239 } | 232 } |
| 240 | 233 |
| 241 } // namespace content | 234 } // namespace content |
| OLD | NEW |