| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
| 9 #include "base/feature_list.h" |
| 9 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 10 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 11 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 13 #include "base/metrics/statistics_recorder.h" | 14 #include "base/metrics/statistics_recorder.h" |
| 14 #include "base/pending_task.h" | 15 #include "base/pending_task.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/sys_info.h" | 17 #include "base/sys_info.h" |
| 17 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
| 18 #include "base/timer/hi_res_timer_manager.h" | 19 #include "base/timer/hi_res_timer_manager.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 base::FieldTrialList field_trial_list(NULL); | 153 base::FieldTrialList field_trial_list(NULL); |
| 153 // Ensure any field trials in browser are reflected into renderer. | 154 // Ensure any field trials in browser are reflected into renderer. |
| 154 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { | 155 if (parsed_command_line.HasSwitch(switches::kForceFieldTrials)) { |
| 155 bool result = base::FieldTrialList::CreateTrialsFromString( | 156 bool result = base::FieldTrialList::CreateTrialsFromString( |
| 156 parsed_command_line.GetSwitchValueASCII(switches::kForceFieldTrials), | 157 parsed_command_line.GetSwitchValueASCII(switches::kForceFieldTrials), |
| 157 base::FieldTrialList::DONT_ACTIVATE_TRIALS, | 158 base::FieldTrialList::DONT_ACTIVATE_TRIALS, |
| 158 std::set<std::string>()); | 159 std::set<std::string>()); |
| 159 DCHECK(result); | 160 DCHECK(result); |
| 160 } | 161 } |
| 161 | 162 |
| 163 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 164 feature_list->InitializeFromCommandLine( |
| 165 parsed_command_line.GetSwitchValueASCII(switches::kEnableFeatures), |
| 166 parsed_command_line.GetSwitchValueASCII(switches::kDisableFeatures)); |
| 167 base::FeatureList::SetInstance(feature_list.Pass()); |
| 168 |
| 162 // PlatformInitialize uses FieldTrials, so this must happen later. | 169 // PlatformInitialize uses FieldTrials, so this must happen later. |
| 163 platform.PlatformInitialize(); | 170 platform.PlatformInitialize(); |
| 164 | 171 |
| 165 #if defined(ENABLE_PLUGINS) | 172 #if defined(ENABLE_PLUGINS) |
| 166 // Load pepper plugins before engaging the sandbox. | 173 // Load pepper plugins before engaging the sandbox. |
| 167 PepperPluginRegistry::GetInstance(); | 174 PepperPluginRegistry::GetInstance(); |
| 168 #endif | 175 #endif |
| 169 #if defined(ENABLE_WEBRTC) | 176 #if defined(ENABLE_WEBRTC) |
| 170 // Initialize WebRTC before engaging the sandbox. | 177 // Initialize WebRTC before engaging the sandbox. |
| 171 // NOTE: On linux, this call could already have been made from | 178 // NOTE: On linux, this call could already have been made from |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // ignore shutdown-only leaks. | 213 // ignore shutdown-only leaks. |
| 207 __lsan_do_leak_check(); | 214 __lsan_do_leak_check(); |
| 208 #endif | 215 #endif |
| 209 } | 216 } |
| 210 platform.PlatformUninitialize(); | 217 platform.PlatformUninitialize(); |
| 211 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 218 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 212 return 0; | 219 return 0; |
| 213 } | 220 } |
| 214 | 221 |
| 215 } // namespace content | 222 } // namespace content |
| OLD | NEW |