OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/base/net_log_logger.h" | 5 #include "net/base/net_log_logger.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/metrics/field_trial.h" |
12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "net/base/address_family.h" | 15 #include "net/base/address_family.h" |
15 #include "net/base/load_states.h" | 16 #include "net/base/load_states.h" |
16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
17 #include "net/quic/quic_protocol.h" | 18 #include "net/quic/quic_protocol.h" |
18 #include "net/quic/quic_utils.h" | 19 #include "net/quic/quic_utils.h" |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 252 |
252 // Pass it as a string, since it may be too large to fit in an integer. | 253 // Pass it as a string, since it may be too large to fit in an integer. |
253 constants_dict->SetString("timeTickOffset", | 254 constants_dict->SetString("timeTickOffset", |
254 base::Int64ToString(tick_to_unix_time_ms)); | 255 base::Int64ToString(tick_to_unix_time_ms)); |
255 } | 256 } |
256 | 257 |
257 // "clientInfo" key is required for some NetLogLogger log readers. | 258 // "clientInfo" key is required for some NetLogLogger log readers. |
258 // Provide a default empty value for compatibility. | 259 // Provide a default empty value for compatibility. |
259 constants_dict->Set("clientInfo", new base::DictionaryValue()); | 260 constants_dict->Set("clientInfo", new base::DictionaryValue()); |
260 | 261 |
| 262 // Add a list of active field experiments. |
| 263 { |
| 264 base::FieldTrial::ActiveGroups active_groups; |
| 265 base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups); |
| 266 base::ListValue* field_trial_groups = new base::ListValue(); |
| 267 for (base::FieldTrial::ActiveGroups::const_iterator it = |
| 268 active_groups.begin(); |
| 269 it != active_groups.end(); ++it) { |
| 270 field_trial_groups->AppendString(it->trial_name + ":" + |
| 271 it->group_name); |
| 272 } |
| 273 constants_dict->Set("activeFieldTrialGroups", field_trial_groups); |
| 274 } |
| 275 |
261 return constants_dict; | 276 return constants_dict; |
262 } | 277 } |
263 | 278 |
264 } // namespace net | 279 } // namespace net |
OLD | NEW |