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" |
11 #include "base/debug/leak_annotations.h" | 11 #include "base/debug/leak_annotations.h" |
12 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/metrics/field_trial.h" | 15 #include "base/metrics/field_trial.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram_macros.h" |
17 #include "base/metrics/statistics_recorder.h" | 17 #include "base/metrics/statistics_recorder.h" |
18 #include "base/pending_task.h" | 18 #include "base/pending_task.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
21 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
| 22 #include "base/timer/elapsed_timer.h" |
22 #include "base/timer/hi_res_timer_manager.h" | 23 #include "base/timer/hi_res_timer_manager.h" |
23 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
25 #include "components/scheduler/renderer/renderer_scheduler.h" | 26 #include "components/scheduler/renderer/renderer_scheduler.h" |
26 #include "content/child/child_process.h" | 27 #include "content/child/child_process.h" |
27 #include "content/common/content_constants_internal.h" | 28 #include "content/common/content_constants_internal.h" |
28 #include "content/common/mojo/mojo_shell_connection_impl.h" | 29 #include "content/common/mojo/mojo_shell_connection_impl.h" |
29 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
30 #include "content/public/common/main_function_params.h" | 31 #include "content/public/common/main_function_params.h" |
31 #include "content/public/renderer/content_renderer_client.h" | 32 #include "content/public/renderer/content_renderer_client.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't | 87 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't |
87 // expect synchronous events around the main loop of a thread. | 88 // expect synchronous events around the main loop of a thread. |
88 TRACE_EVENT_ASYNC_BEGIN0("startup", "RendererMain", 0); | 89 TRACE_EVENT_ASYNC_BEGIN0("startup", "RendererMain", 0); |
89 | 90 |
90 base::trace_event::TraceLog::GetInstance()->SetProcessName("Renderer"); | 91 base::trace_event::TraceLog::GetInstance()->SetProcessName("Renderer"); |
91 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( | 92 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( |
92 kTraceEventRendererProcessSortIndex); | 93 kTraceEventRendererProcessSortIndex); |
93 | 94 |
94 const base::CommandLine& parsed_command_line = parameters.command_line; | 95 const base::CommandLine& parsed_command_line = parameters.command_line; |
95 | 96 |
96 MojoShellConnectionImpl::Create(); | 97 { |
| 98 base::ElapsedTimer timer; |
| 99 MojoShellConnectionImpl::Create(); |
| 100 UMA_HISTOGRAM_TIMES("Mojo.Shell.RenderProcessInitializationTime", |
| 101 timer.Elapsed()); |
| 102 } |
97 | 103 |
98 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
99 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 105 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
100 #endif // OS_MACOSX | 106 #endif // OS_MACOSX |
101 | 107 |
102 #if defined(OS_CHROMEOS) | 108 #if defined(OS_CHROMEOS) |
103 // As Zygote process starts up earlier than browser process gets its own | 109 // As Zygote process starts up earlier than browser process gets its own |
104 // locale (at login time for Chrome OS), we have to set the ICU default | 110 // locale (at login time for Chrome OS), we have to set the ICU default |
105 // locale for renderer process here. | 111 // locale for renderer process here. |
106 // ICU locale will be used for fallback font selection etc. | 112 // ICU locale will be used for fallback font selection etc. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // ignore shutdown-only leaks. | 233 // ignore shutdown-only leaks. |
228 __lsan_do_leak_check(); | 234 __lsan_do_leak_check(); |
229 #endif | 235 #endif |
230 } | 236 } |
231 platform.PlatformUninitialize(); | 237 platform.PlatformUninitialize(); |
232 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 238 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
233 return 0; | 239 return 0; |
234 } | 240 } |
235 | 241 |
236 } // namespace content | 242 } // namespace content |
OLD | NEW |