| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/tracing/background_tracing_config_impl.h" | 5 #include "content/browser/tracing/background_tracing_config_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 dict->SetString(kConfigModeKey, kConfigModePreemptive); | 138 dict->SetString(kConfigModeKey, kConfigModePreemptive); |
| 139 dict->SetString(kConfigCategoryKey, | 139 dict->SetString(kConfigCategoryKey, |
| 140 CategoryPresetToString(category_preset_)); | 140 CategoryPresetToString(category_preset_)); |
| 141 break; | 141 break; |
| 142 case BackgroundTracingConfigImpl::REACTIVE: | 142 case BackgroundTracingConfigImpl::REACTIVE: |
| 143 dict->SetString(kConfigModeKey, kConfigModeReactive); | 143 dict->SetString(kConfigModeKey, kConfigModeReactive); |
| 144 break; | 144 break; |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::unique_ptr<base::ListValue> configs_list(new base::ListValue()); | 147 std::unique_ptr<base::ListValue> configs_list(new base::ListValue()); |
| 148 for (auto* it : rules_) { | 148 for (const auto& rule : rules_) { |
| 149 std::unique_ptr<base::DictionaryValue> config_dict( | 149 std::unique_ptr<base::DictionaryValue> config_dict( |
| 150 new base::DictionaryValue()); | 150 new base::DictionaryValue()); |
| 151 DCHECK(it); | 151 DCHECK(rule); |
| 152 it->IntoDict(config_dict.get()); | 152 rule->IntoDict(config_dict.get()); |
| 153 configs_list->Append(std::move(config_dict)); | 153 configs_list->Append(std::move(config_dict)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 dict->Set(kConfigsKey, std::move(configs_list)); | 156 dict->Set(kConfigsKey, std::move(configs_list)); |
| 157 | 157 |
| 158 if (!scenario_name_.empty()) | 158 if (!scenario_name_.empty()) |
| 159 dict->SetString(kConfigScenarioName, scenario_name_); | 159 dict->SetString(kConfigScenarioName, scenario_name_); |
| 160 if (!enable_blink_features_.empty()) | 160 if (!enable_blink_features_.empty()) |
| 161 dict->SetString(kConfigEnableBlinkFeatures, enable_blink_features_); | 161 dict->SetString(kConfigEnableBlinkFeatures, enable_blink_features_); |
| 162 if (!disable_blink_features_.empty()) | 162 if (!disable_blink_features_.empty()) |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 config->AddReactiveRule(config_dict, new_category_preset); | 273 config->AddReactiveRule(config_dict, new_category_preset); |
| 274 } | 274 } |
| 275 | 275 |
| 276 if (config->rules().empty()) | 276 if (config->rules().empty()) |
| 277 return nullptr; | 277 return nullptr; |
| 278 | 278 |
| 279 return config; | 279 return config; |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namspace content | 282 } // namspace content |
| OLD | NEW |