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