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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/lazy_instance.h" | 25 #include "base/lazy_instance.h" |
26 #include "base/logging.h" | 26 #include "base/logging.h" |
27 #include "base/macros.h" | 27 #include "base/macros.h" |
28 #include "base/memory/scoped_vector.h" | 28 #include "base/memory/scoped_vector.h" |
29 #include "base/metrics/field_trial.h" | 29 #include "base/metrics/field_trial.h" |
30 #include "base/metrics/histogram_base.h" | 30 #include "base/metrics/histogram_base.h" |
31 #include "base/metrics/statistics_recorder.h" | 31 #include "base/metrics/statistics_recorder.h" |
32 #include "base/path_service.h" | 32 #include "base/path_service.h" |
33 #include "base/process/launch.h" | 33 #include "base/process/launch.h" |
34 #include "base/process/memory.h" | 34 #include "base/process/memory.h" |
| 35 #include "base/process/process.h" |
35 #include "base/process/process_handle.h" | 36 #include "base/process/process_handle.h" |
36 #include "base/profiler/scoped_tracker.h" | 37 #include "base/profiler/scoped_tracker.h" |
37 #include "base/strings/string_number_conversions.h" | 38 #include "base/strings/string_number_conversions.h" |
38 #include "base/strings/string_util.h" | 39 #include "base/strings/string_util.h" |
39 #include "base/strings/stringprintf.h" | 40 #include "base/strings/stringprintf.h" |
40 #include "base/trace_event/trace_event.h" | 41 #include "base/trace_event/trace_event.h" |
41 #include "build/build_config.h" | 42 #include "build/build_config.h" |
42 #include "components/tracing/browser/trace_config_file.h" | 43 #include "components/tracing/browser/trace_config_file.h" |
43 #include "components/tracing/common/trace_to_console.h" | 44 #include "components/tracing/common/trace_to_console.h" |
44 #include "components/tracing/common/tracing_switches.h" | 45 #include "components/tracing/common/tracing_switches.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 *base::CommandLine::ForCurrentProcess(); | 136 *base::CommandLine::ForCurrentProcess(); |
136 | 137 |
137 // Initialize statistical testing infrastructure. We set the entropy | 138 // Initialize statistical testing infrastructure. We set the entropy |
138 // provider to nullptr to disallow non-browser processes from creating | 139 // provider to nullptr to disallow non-browser processes from creating |
139 // their own one-time randomized trials; they should be created in the | 140 // their own one-time randomized trials; they should be created in the |
140 // browser process. | 141 // browser process. |
141 field_trial_list->reset(new base::FieldTrialList(nullptr)); | 142 field_trial_list->reset(new base::FieldTrialList(nullptr)); |
142 | 143 |
143 // Ensure any field trials in browser are reflected into the child | 144 // Ensure any field trials in browser are reflected into the child |
144 // process. | 145 // process. |
145 if (command_line.HasSwitch(switches::kForceFieldTrials)) { | 146 base::FieldTrialList::CreateTrialsFromCommandLine( |
146 bool result = base::FieldTrialList::CreateTrialsFromString( | 147 command_line, switches::kFieldTrialHandle); |
147 command_line.GetSwitchValueASCII(switches::kForceFieldTrials), | |
148 std::set<std::string>()); | |
149 DCHECK(result); | |
150 } | |
151 | 148 |
152 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | 149 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
153 feature_list->InitializeFromCommandLine( | 150 feature_list->InitializeFromCommandLine( |
154 command_line.GetSwitchValueASCII(switches::kEnableFeatures), | 151 command_line.GetSwitchValueASCII(switches::kEnableFeatures), |
155 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); | 152 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); |
156 base::FeatureList::SetInstance(std::move(feature_list)); | 153 base::FeatureList::SetInstance(std::move(feature_list)); |
157 } | 154 } |
158 | 155 |
159 } // namespace | 156 } // namespace |
160 | 157 |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 832 |
836 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 833 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
837 }; | 834 }; |
838 | 835 |
839 // static | 836 // static |
840 ContentMainRunner* ContentMainRunner::Create() { | 837 ContentMainRunner* ContentMainRunner::Create() { |
841 return new ContentMainRunnerImpl(); | 838 return new ContentMainRunnerImpl(); |
842 } | 839 } |
843 | 840 |
844 } // namespace content | 841 } // namespace content |
OLD | NEW |