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

Side by Side Diff: content/browser/tracing/background_tracing_manager_impl.cc

Issue 1277503005: Fixed variable shadowing in BackgroundTracingManagerImpl::IsSupportedConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager_impl.h" 5 #include "content/browser/tracing/background_tracing_manager_impl.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 idle_callback_ = idle_callback; 131 idle_callback_ = idle_callback;
132 } 132 }
133 133
134 bool BackgroundTracingManagerImpl::IsSupportedConfig( 134 bool BackgroundTracingManagerImpl::IsSupportedConfig(
135 BackgroundTracingConfig* config) { 135 BackgroundTracingConfig* config) {
136 // No config is just fine, we just don't do anything. 136 // No config is just fine, we just don't do anything.
137 if (!config) 137 if (!config)
138 return true; 138 return true;
139 139
140 if (config->mode == BackgroundTracingConfig::PREEMPTIVE_TRACING_MODE) { 140 if (config->mode == BackgroundTracingConfig::PREEMPTIVE_TRACING_MODE) {
141 BackgroundTracingPreemptiveConfig* preemptive_config = 141 for (const auto& preemptive_config :
142 static_cast<BackgroundTracingPreemptiveConfig*>(config); 142 static_cast<BackgroundTracingPreemptiveConfig*>(config)->configs) {
143 for (const auto& config : preemptive_config->configs) { 143 if (preemptive_config.type == BackgroundTracingPreemptiveConfig::
144 if (config.type == BackgroundTracingPreemptiveConfig:: 144 MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED ||
145 MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED || 145 preemptive_config.type ==
146 config.type ==
147 BackgroundTracingPreemptiveConfig:: 146 BackgroundTracingPreemptiveConfig::
148 MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE) { 147 MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE) {
149 continue; 148 continue;
150 } 149 }
151 return false; 150 return false;
152 } 151 }
153 } 152 }
154 153
155 if (config->mode == BackgroundTracingConfig::REACTIVE_TRACING_MODE) { 154 if (config->mode == BackgroundTracingConfig::REACTIVE_TRACING_MODE) {
156 BackgroundTracingReactiveConfig* reactive_config = 155 for (const auto& reactive_config :
157 static_cast<BackgroundTracingReactiveConfig*>(config); 156 static_cast<BackgroundTracingReactiveConfig*>(config)->configs) {
158 for (const auto& config : reactive_config->configs) { 157 if (reactive_config.type !=
159 if (config.type !=
160 BackgroundTracingReactiveConfig::TRACE_FOR_10S_OR_TRIGGER_OR_FULL) 158 BackgroundTracingReactiveConfig::TRACE_FOR_10S_OR_TRIGGER_OR_FULL)
161 return false; 159 return false;
162 } 160 }
163 } 161 }
164 162
165 return true; 163 return true;
166 } 164 }
167 165
168 void BackgroundTracingManagerImpl::SetupUMACallbacks( 166 void BackgroundTracingManagerImpl::SetupUMACallbacks(
169 BackgroundTracingManagerImpl::SetupUMACallMode mode) { 167 BackgroundTracingManagerImpl::SetupUMACallMode mode) {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 case BackgroundTracingConfig::CategoryPreset::BENCHMARK: 611 case BackgroundTracingConfig::CategoryPreset::BENCHMARK:
614 return "benchmark,toplevel"; 612 return "benchmark,toplevel";
615 case BackgroundTracingConfig::CategoryPreset::BENCHMARK_DEEP: 613 case BackgroundTracingConfig::CategoryPreset::BENCHMARK_DEEP:
616 return "*,disabled-by-default-benchmark.detailed"; 614 return "*,disabled-by-default-benchmark.detailed";
617 } 615 }
618 NOTREACHED(); 616 NOTREACHED();
619 return ""; 617 return "";
620 } 618 }
621 619
622 } // namspace content 620 } // namspace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698