Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: content/app/content_main_runner.cc

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: add missing include Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
Alexei Svitkine (slow) 2016/10/06 21:39:28 Is this include needed?
lawrencewu 2016/10/07 15:07:21 Nope. Removed.
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 *base::CommandLine::ForCurrentProcess(); 139 *base::CommandLine::ForCurrentProcess();
139 140
140 // Initialize statistical testing infrastructure. We set the entropy 141 // Initialize statistical testing infrastructure. We set the entropy
141 // provider to nullptr to disallow non-browser processes from creating 142 // provider to nullptr to disallow non-browser processes from creating
142 // their own one-time randomized trials; they should be created in the 143 // their own one-time randomized trials; they should be created in the
143 // browser process. 144 // browser process.
144 field_trial_list->reset(new base::FieldTrialList(nullptr)); 145 field_trial_list->reset(new base::FieldTrialList(nullptr));
145 146
146 // Ensure any field trials in browser are reflected into the child 147 // Ensure any field trials in browser are reflected into the child
147 // process. 148 // process.
148 if (command_line.HasSwitch(switches::kForceFieldTrials)) { 149 base::FieldTrialList::CreateTrialsFromCommandLine(
149 bool result = base::FieldTrialList::CreateTrialsFromString( 150 command_line, switches::kFieldTrialHandle);
150 command_line.GetSwitchValueASCII(switches::kForceFieldTrials),
151 std::set<std::string>());
152 DCHECK(result);
153 }
154 151
155 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); 152 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
156 feature_list->InitializeFromCommandLine( 153 feature_list->InitializeFromCommandLine(
157 command_line.GetSwitchValueASCII(switches::kEnableFeatures), 154 command_line.GetSwitchValueASCII(switches::kEnableFeatures),
158 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); 155 command_line.GetSwitchValueASCII(switches::kDisableFeatures));
159 base::FeatureList::SetInstance(std::move(feature_list)); 156 base::FeatureList::SetInstance(std::move(feature_list));
160 } 157 }
161 158
162 } // namespace 159 } // namespace
163 160
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 838
842 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 839 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
843 }; 840 };
844 841
845 // static 842 // static
846 ContentMainRunner* ContentMainRunner::Create() { 843 ContentMainRunner* ContentMainRunner::Create() {
847 return new ContentMainRunnerImpl(); 844 return new ContentMainRunnerImpl();
848 } 845 }
849 846
850 } // namespace content 847 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698