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" | |
13 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
14 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
15 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
16 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
17 #include "base/metrics/statistics_recorder.h" | 16 #include "base/metrics/statistics_recorder.h" |
18 #include "base/pending_task.h" | 17 #include "base/pending_task.h" |
19 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
20 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
21 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
22 #include "base/timer/hi_res_timer_manager.h" | 21 #include "base/timer/hi_res_timer_manager.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 147 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
149 | 148 |
150 // Initialize histogram statistics gathering system. | 149 // Initialize histogram statistics gathering system. |
151 base::StatisticsRecorder::Initialize(); | 150 base::StatisticsRecorder::Initialize(); |
152 | 151 |
153 #if defined(OS_ANDROID) | 152 #if defined(OS_ANDROID) |
154 // If we have a pending chromium android linker histogram, record it. | 153 // If we have a pending chromium android linker histogram, record it. |
155 base::android::RecordChromiumAndroidLinkerRendererHistogram(); | 154 base::android::RecordChromiumAndroidLinkerRendererHistogram(); |
156 #endif | 155 #endif |
157 | 156 |
158 // Initialize statistical testing infrastructure. We set the entropy provider | |
159 // to NULL to disallow the renderer process from creating its own one-time | |
160 // randomized trials; they should be created in the browser process. | |
161 base::FieldTrialList field_trial_list(NULL); | |
162 // Ensure any field trials in browser are reflected into renderer. | |
163 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { | |
164 bool result = base::FieldTrialList::CreateTrialsFromString( | |
165 parsed_command_line.GetSwitchValueASCII(switches::kForceFieldTrials), | |
166 std::set<std::string>()); | |
167 DCHECK(result); | |
168 } | |
169 | |
170 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
171 feature_list->InitializeFromCommandLine( | |
172 parsed_command_line.GetSwitchValueASCII(switches::kEnableFeatures), | |
173 parsed_command_line.GetSwitchValueASCII(switches::kDisableFeatures)); | |
174 base::FeatureList::SetInstance(std::move(feature_list)); | |
Alexei Svitkine (slow)
2016/05/03 18:59:47
What happened to remove this? I don't see it in th
erikchen
2016/05/03 19:22:31
Moving this logic to contain_main_runner causes pr
| |
175 | |
176 std::unique_ptr<scheduler::RendererScheduler> renderer_scheduler( | 157 std::unique_ptr<scheduler::RendererScheduler> renderer_scheduler( |
177 scheduler::RendererScheduler::Create()); | 158 scheduler::RendererScheduler::Create()); |
178 | 159 |
179 // PlatformInitialize uses FieldTrials, so this must happen later. | 160 // PlatformInitialize uses FieldTrials, so this must happen later. |
180 platform.PlatformInitialize(); | 161 platform.PlatformInitialize(); |
181 | 162 |
182 #if defined(ENABLE_PLUGINS) | 163 #if defined(ENABLE_PLUGINS) |
183 // Load pepper plugins before engaging the sandbox. | 164 // Load pepper plugins before engaging the sandbox. |
184 PepperPluginRegistry::GetInstance(); | 165 PepperPluginRegistry::GetInstance(); |
185 #endif | 166 #endif |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 // ignore shutdown-only leaks. | 208 // ignore shutdown-only leaks. |
228 __lsan_do_leak_check(); | 209 __lsan_do_leak_check(); |
229 #endif | 210 #endif |
230 } | 211 } |
231 platform.PlatformUninitialize(); | 212 platform.PlatformUninitialize(); |
232 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); | 213 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); |
233 return 0; | 214 return 0; |
234 } | 215 } |
235 | 216 |
236 } // namespace content | 217 } // namespace content |
OLD | NEW |