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

Unified Diff: net/base/net_log_logger.cc

Issue 671253002: Added the list of active field groups to NetLog dump (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/base/net_log_logger.cc
diff --git a/net/base/net_log_logger.cc b/net/base/net_log_logger.cc
index 76b5b32224fe31d3004877180ab091239f66cea5..6a860bc3b547de81627609696630f5d473904442 100644
--- a/net/base/net_log_logger.cc
+++ b/net/base/net_log_logger.cc
@@ -9,6 +9,7 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/metrics/field_trial.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "net/base/address_family.h"
@@ -258,6 +259,19 @@ base::DictionaryValue* NetLogLogger::GetConstants() {
// Provide a default empty value for compatibility.
constants_dict->Set("clientInfo", new base::DictionaryValue());
+ // Add a list of active field experiments.
+ {
+ base::FieldTrial::ActiveGroups active_groups;
+ base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
+ base::ListValue* field_trial_groups = new base::ListValue();
+ for (base::FieldTrial::ActiveGroups::const_iterator it =
+ active_groups.begin(); it != active_groups.end(); ++it) {
mmenke 2014/10/23 21:46:45 optional nit: Suggest putting a linebreak after t
xunjieli 2014/10/23 22:18:38 Got it! Done.
+ field_trial_groups->AppendString(it->trial_name + ":" +
+ it->group_name);
+ }
+ constants_dict->Set("activeFieldTrialGroups", field_trial_groups);
+ }
+
return constants_dict;
}

Powered by Google App Engine
This is Rietveld 408576698