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

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

Issue 10907121: Add guards to metric values; erase bad events/metrics from db (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_use_units
Patch Set: Estade's requests Created 8 years, 3 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 | « chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_util_unittest.cc ('k') | 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 (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/web_ui_handler.h" 5 #include "chrome/browser/ui/webui/performance_monitor/web_ui_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 Database::MetricVectorMap metric_vector_map = 318 Database::MetricVectorMap metric_vector_map =
319 db->GetStatsForMetricByActivity(metric_type, start, end); 319 db->GetStatsForMetricByActivity(metric_type, start, end);
320 320
321 linked_ptr<Database::MetricVector> metric_vector = 321 linked_ptr<Database::MetricVector> metric_vector =
322 metric_vector_map[kProcessChromeAggregate]; 322 metric_vector_map[kProcessChromeAggregate];
323 323
324 ConvertUnitsAndPopulateMetricResults( 324 ConvertUnitsAndPopulateMetricResults(
325 results, 325 results,
326 metric_type, 326 metric_type,
327 db->GetMaxStatsForActivityAndMetric(metric_type), 327 db->GetMaxStatsForActivityAndMetric(metric_type),
328 AggregateMetric(metric_vector.get(), 328 AggregateMetric(metric_type,
329 metric_vector.get(),
329 start, 330 start,
330 resolution).get()); 331 resolution).get());
331 } 332 }
332 333
333 } // namespace 334 } // namespace
334 335
335 WebUIHandler::WebUIHandler() { 336 WebUIHandler::WebUIHandler() {
336 // If we are not running the --run-performance-monitor flag, we will not have 337 // If we are not running the --run-performance-monitor flag, we will not have
337 // started PerformanceMonitor. 338 // started PerformanceMonitor.
338 if (!PerformanceMonitor::initialized()) 339 if (!PerformanceMonitor::initialized())
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 util::PostTaskToDatabaseThreadAndReply( 457 util::PostTaskToDatabaseThreadAndReply(
457 FROM_HERE, 458 FROM_HERE,
458 base::Bind(&DoGetMetric, results, metric_type, 459 base::Bind(&DoGetMetric, results, metric_type,
459 start, end, resolution), 460 start, end, resolution),
460 base::Bind(&WebUIHandler::ReturnResults, AsWeakPtr(), 461 base::Bind(&WebUIHandler::ReturnResults, AsWeakPtr(),
461 "PerformanceMonitor.getMetricCallback", 462 "PerformanceMonitor.getMetricCallback",
462 base::Owned(results))); 463 base::Owned(results)));
463 } 464 }
464 465
465 } // namespace performance_monitor 466 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698