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 |
101 const base::CommandLine& parsed_command_line = parameters.command_line; | 108 const base::CommandLine& parsed_command_line = parameters.command_line; |
102 | 109 |
103 #if defined(OS_MACOSX) | 110 #if defined(OS_MACOSX) |
104 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 111 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
105 #endif // OS_MACOSX | 112 #endif // OS_MACOSX |
106 | 113 |
107 #if defined(OS_CHROMEOS) | 114 #if defined(OS_CHROMEOS) |
108 // As Zygote process starts up earlier than browser process gets its own | 115 // As Zygote process starts up earlier than browser process gets its own |
109 // locale (at login time for Chrome OS), we have to set the ICU default | 116 // locale (at login time for Chrome OS), we have to set the ICU default |
110 // locale for renderer process here. | 117 // locale for renderer process here. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // ignore shutdown-only leaks. | 232 // ignore shutdown-only leaks. |
226 __lsan_do_leak_check(); | 233 __lsan_do_leak_check(); |
227 #endif | 234 #endif |
228 } | 235 } |
229 platform.PlatformUninitialize(); | 236 platform.PlatformUninitialize(); |
230 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 237 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
231 return 0; | 238 return 0; |
232 } | 239 } |
233 | 240 |
234 } // namespace content | 241 } // namespace content |
OLD | NEW |