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

Side by Side Diff: chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_util.cc

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti l.h" 5 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_uti l.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "chrome/browser/performance_monitor/metric.h" 10 #include "chrome/browser/performance_monitor/metric.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 scoped_ptr<VectorOfMetricVectors> AggregateMetric( 167 scoped_ptr<VectorOfMetricVectors> AggregateMetric(
168 MetricType type, 168 MetricType type,
169 const Database::MetricVector* metrics, 169 const Database::MetricVector* metrics,
170 const base::Time& start, 170 const base::Time& start,
171 const std::vector<TimeRange>& intervals, 171 const std::vector<TimeRange>& intervals,
172 const base::TimeDelta& resolution, 172 const base::TimeDelta& resolution,
173 AggregationMethod method) { 173 AggregationMethod method) {
174 if (!metrics || intervals.empty()) 174 if (!metrics || intervals.empty())
175 return scoped_ptr<VectorOfMetricVectors>(NULL); 175 return scoped_ptr<VectorOfMetricVectors>();
176 176
177 CHECK(resolution > base::TimeDelta()); 177 CHECK(resolution > base::TimeDelta());
178 178
179 switch (method) { 179 switch (method) {
180 case AGGREGATION_METHOD_NONE: 180 case AGGREGATION_METHOD_NONE:
181 return NoAggregation().AggregateMetrics( 181 return NoAggregation().AggregateMetrics(
182 type, metrics, start, intervals, resolution); 182 type, metrics, start, intervals, resolution);
183 case AGGREGATION_METHOD_MEDIAN: 183 case AGGREGATION_METHOD_MEDIAN:
184 return MedianAggregation().AggregateMetrics( 184 return MedianAggregation().AggregateMetrics(
185 type, metrics, start, intervals, resolution); 185 type, metrics, start, intervals, resolution);
186 case AGGREGATION_METHOD_MEAN: 186 case AGGREGATION_METHOD_MEAN:
187 return MeanAggregation().AggregateMetrics( 187 return MeanAggregation().AggregateMetrics(
188 type, metrics, start, intervals, resolution); 188 type, metrics, start, intervals, resolution);
189 default: 189 default:
190 NOTREACHED(); 190 NOTREACHED();
191 return scoped_ptr<VectorOfMetricVectors>(NULL); 191 return scoped_ptr<VectorOfMetricVectors>();
192 } 192 }
193 } 193 }
194 194
195 } // namespace performance_monitor 195 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698