| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 147 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
| 148 | 148 |
| 149 // Initialize histogram statistics gathering system. | 149 // Initialize histogram statistics gathering system. |
| 150 base::StatisticsRecorder::Initialize(); | 150 base::StatisticsRecorder::Initialize(); |
| 151 | 151 |
| 152 #if defined(OS_ANDROID) | 152 #if defined(OS_ANDROID) |
| 153 // If we have any pending LibraryLoader histograms, record them. | 153 // If we have any pending LibraryLoader histograms, record them. |
| 154 base::android::RecordLibraryLoaderRendererHistograms(); | 154 base::android::RecordLibraryLoaderRendererHistograms(); |
| 155 #endif | 155 #endif |
| 156 | 156 |
| 157 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler( | 157 using blink::scheduler::RendererScheduler; |
| 158 blink::scheduler::RendererScheduler::Create()); | 158 const bool can_be_backgrounded = |
| 159 GetContentClient()->renderer()->CanBeBackgrounded(); |
| 160 std::unique_ptr<RendererScheduler> renderer_scheduler( |
| 161 RendererScheduler::Create( |
| 162 can_be_backgrounded |
| 163 ? RendererScheduler::RendererType::kForegroundAndBackground |
| 164 : RendererScheduler::RendererType::kForegroundOnly)); |
| 159 | 165 |
| 160 // PlatformInitialize uses FieldTrials, so this must happen later. | 166 // PlatformInitialize uses FieldTrials, so this must happen later. |
| 161 platform.PlatformInitialize(); | 167 platform.PlatformInitialize(); |
| 162 | 168 |
| 163 #if BUILDFLAG(ENABLE_PLUGINS) | 169 #if BUILDFLAG(ENABLE_PLUGINS) |
| 164 // Load pepper plugins before engaging the sandbox. | 170 // Load pepper plugins before engaging the sandbox. |
| 165 PepperPluginRegistry::GetInstance(); | 171 PepperPluginRegistry::GetInstance(); |
| 166 #endif | 172 #endif |
| 167 #if BUILDFLAG(ENABLE_WEBRTC) | 173 #if BUILDFLAG(ENABLE_WEBRTC) |
| 168 // Initialize WebRTC before engaging the sandbox. | 174 // Initialize WebRTC before engaging the sandbox. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // ignore shutdown-only leaks. | 212 // ignore shutdown-only leaks. |
| 207 __lsan_do_leak_check(); | 213 __lsan_do_leak_check(); |
| 208 #endif | 214 #endif |
| 209 } | 215 } |
| 210 platform.PlatformUninitialize(); | 216 platform.PlatformUninitialize(); |
| 211 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 217 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
| 212 return 0; | 218 return 0; |
| 213 } | 219 } |
| 214 | 220 |
| 215 } // namespace content | 221 } // namespace content |
| OLD | NEW |