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

Unified Diff: content/common/child_process_host_impl.cc

Issue 1928863002: Enable FeatureList for the GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Zygote process! Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/common/child_process_host_impl.cc
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
index e9b81e75f9d894f99bc530a4fbe79bf8c9609dff..b3268b0cb2a00ea559b0c32ef6004ffa4c18bd5e 100644
--- a/content/common/child_process_host_impl.cc
+++ b/content/common/child_process_host_impl.cc
@@ -7,11 +7,14 @@
#include <limits>
#include "base/atomic_sequence_num.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/hash.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/numerics/safe_math.h"
#include "base/path_service.h"
@@ -198,6 +201,28 @@ int ChildProcessHostImpl::GenerateChildProcessUniqueId() {
return id;
}
+void ChildProcessHostImpl::CopyEnableDisableFeatureFlags(
Alexei Svitkine (slow) 2016/05/03 18:59:47 Nit: CopyFeatureAndFieldTrialFlags() since now thi
erikchen 2016/05/03 19:22:31 Done.
+ base::CommandLine* cmd_line) {
+ std::string enabled_features;
+ std::string disabled_features;
+ base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features,
+ &disabled_features);
+ if (!enabled_features.empty())
+ cmd_line->AppendSwitchASCII(switches::kEnableFeatures, enabled_features);
+ if (!disabled_features.empty())
+ cmd_line->AppendSwitchASCII(switches::kDisableFeatures, disabled_features);
+
+ // If we run base::FieldTrials, we want to pass to their state to the
+ // child process so that it can act in accordance with each state, or record
+ // histograms relating to the base::FieldTrial states.
Alexei Svitkine (slow) 2016/05/03 18:59:47 Nit: I'd remove the ", or record histograms relati
erikchen 2016/05/03 19:22:31 Done.
+ std::string field_trial_states;
+ base::FieldTrialList::AllStatesToString(&field_trial_states);
+ if (!field_trial_states.empty()) {
+ cmd_line->AppendSwitchASCII(switches::kForceFieldTrials,
+ field_trial_states);
+ }
+}
+
uint64_t ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
int child_process_id) {
// In single process mode, all the children are hosted in the same process,

Powered by Google App Engine
This is Rietveld 408576698