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

Unified Diff: content/browser/tracing/background_tracing_manager_impl.cc

Issue 2752533003: Remove ScopedVector from content/browser/. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « content/browser/tracing/background_tracing_config_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/background_tracing_manager_impl.cc
diff --git a/content/browser/tracing/background_tracing_manager_impl.cc b/content/browser/tracing/background_tracing_manager_impl.cc
index 4e64d07d5f5277e8653e169f55c2a8e463825e15..51ebefe377e375f40ffb3491a704f17f283c5c3a 100644
--- a/content/browser/tracing/background_tracing_manager_impl.cc
+++ b/content/browser/tracing/background_tracing_manager_impl.cc
@@ -178,9 +178,9 @@ bool BackgroundTracingManagerImpl::SetActiveScenario(
requires_anonymized_data_ = requires_anonymized_data;
if (config_) {
- DCHECK(!config_.get()->rules().empty());
- for (auto* rule : config_.get()->rules())
- static_cast<BackgroundTracingRule*>(rule)->Install();
+ DCHECK(!config_->rules().empty());
+ for (const auto& rule : config_->rules())
+ rule->Install();
if (!config_->enable_blink_features().empty()) {
command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures,
@@ -243,10 +243,9 @@ BackgroundTracingManagerImpl::GetRuleAbleToTriggerTracing(
}
std::string trigger_name = GetTriggerNameFromHandle(handle);
- for (auto* rule : config_.get()->rules()) {
- if (static_cast<BackgroundTracingRule*>(rule)
- ->ShouldTriggerNamedEvent(trigger_name))
- return static_cast<BackgroundTracingRule*>(rule);
+ for (const auto& rule : config_->rules()) {
+ if (rule->ShouldTriggerNamedEvent(trigger_name))
+ return rule.get();
}
return nullptr;
@@ -262,9 +261,9 @@ void BackgroundTracingManagerImpl::OnHistogramTrigger(
return;
}
- for (auto* rule : config_->rules()) {
+ for (const auto& rule : config_->rules()) {
if (rule->ShouldTriggerNamedEvent(histogram_name))
- OnRuleTriggered(rule, StartedFinalizingCallback());
+ OnRuleTriggered(rule.get(), StartedFinalizingCallback());
}
}
« no previous file with comments | « content/browser/tracing/background_tracing_config_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698