| 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/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/metrics/statistics_recorder.h" | 15 #include "base/metrics/statistics_recorder.h" |
| 16 #include "base/pending_task.h" | 16 #include "base/pending_task.h" |
| 17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
| 20 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
| 21 #include "base/timer/hi_res_timer_manager.h" | 21 #include "base/timer/hi_res_timer_manager.h" |
| 22 #include "base/trace_event/trace_event.h" | 22 #include "base/trace_event/trace_event.h" |
| 23 #include "base/tracked_objects.h" |
| 23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 24 #include "content/child/child_process.h" | 25 #include "content/child/child_process.h" |
| 25 #include "content/common/content_constants_internal.h" | 26 #include "content/common/content_constants_internal.h" |
| 26 #include "content/common/service_manager/service_manager_connection_impl.h" | 27 #include "content/common/service_manager/service_manager_connection_impl.h" |
| 27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
| 29 #include "content/public/renderer/content_renderer_client.h" | 30 #include "content/public/renderer/content_renderer_client.h" |
| 30 #include "content/renderer/render_process_impl.h" | 31 #include "content/renderer/render_process_impl.h" |
| 31 #include "content/renderer/render_thread_impl.h" | 32 #include "content/renderer/render_thread_impl.h" |
| 32 #include "content/renderer/renderer_main_platform_delegate.h" | 33 #include "content/renderer/renderer_main_platform_delegate.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // http://crbug.com/306348#c24 for details. | 156 // http://crbug.com/306348#c24 for details. |
| 156 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop()); | 157 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop()); |
| 157 std::unique_ptr<base::MessageLoop> main_message_loop( | 158 std::unique_ptr<base::MessageLoop> main_message_loop( |
| 158 new base::MessageLoop(std::move(pump))); | 159 new base::MessageLoop(std::move(pump))); |
| 159 #else | 160 #else |
| 160 // The main message loop of the renderer services doesn't have IO or UI tasks. | 161 // The main message loop of the renderer services doesn't have IO or UI tasks. |
| 161 std::unique_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop()); | 162 std::unique_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop()); |
| 162 #endif | 163 #endif |
| 163 | 164 |
| 164 base::PlatformThread::SetName("CrRendererMain"); | 165 base::PlatformThread::SetName("CrRendererMain"); |
| 166 tracked_objects::ThreadData::Get()->EnableTaskDurationRecordingForUMA(); |
| 165 | 167 |
| 166 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 168 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
| 167 | 169 |
| 168 // Initialize histogram statistics gathering system. | 170 // Initialize histogram statistics gathering system. |
| 169 base::StatisticsRecorder::Initialize(); | 171 base::StatisticsRecorder::Initialize(); |
| 170 | 172 |
| 171 #if defined(OS_ANDROID) | 173 #if defined(OS_ANDROID) |
| 172 // If we have any pending LibraryLoader histograms, record them. | 174 // If we have any pending LibraryLoader histograms, record them. |
| 173 base::android::RecordLibraryLoaderRendererHistograms(); | 175 base::android::RecordLibraryLoaderRendererHistograms(); |
| 174 #endif | 176 #endif |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // ignore shutdown-only leaks. | 227 // ignore shutdown-only leaks. |
| 226 __lsan_do_leak_check(); | 228 __lsan_do_leak_check(); |
| 227 #endif | 229 #endif |
| 228 } | 230 } |
| 229 platform.PlatformUninitialize(); | 231 platform.PlatformUninitialize(); |
| 230 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 232 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
| 231 return 0; | 233 return 0; |
| 232 } | 234 } |
| 233 | 235 |
| 234 } // namespace content | 236 } // namespace content |
| OLD | NEW |