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

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

Issue 10915318: Revert 157168 - Add guards to metric values; erase bad events/metrics from db (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | Annotate | Revision Log
« 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_type, 328 AggregateMetric(metric_vector.get(),
329 metric_vector.get(),
330 start, 329 start,
331 resolution).get()); 330 resolution).get());
332 } 331 }
333 332
334 } // namespace 333 } // namespace
335 334
336 WebUIHandler::WebUIHandler() { 335 WebUIHandler::WebUIHandler() {
337 // If we are not running the --run-performance-monitor flag, we will not have 336 // If we are not running the --run-performance-monitor flag, we will not have
338 // started PerformanceMonitor. 337 // started PerformanceMonitor.
339 if (!PerformanceMonitor::initialized()) 338 if (!PerformanceMonitor::initialized())
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 util::PostTaskToDatabaseThreadAndReply( 456 util::PostTaskToDatabaseThreadAndReply(
458 FROM_HERE, 457 FROM_HERE,
459 base::Bind(&DoGetMetric, results, metric_type, 458 base::Bind(&DoGetMetric, results, metric_type,
460 start, end, resolution), 459 start, end, resolution),
461 base::Bind(&WebUIHandler::ReturnResults, AsWeakPtr(), 460 base::Bind(&WebUIHandler::ReturnResults, AsWeakPtr(),
462 "PerformanceMonitor.getMetricCallback", 461 "PerformanceMonitor.getMetricCallback",
463 base::Owned(results))); 462 base::Owned(results)));
464 } 463 }
465 464
466 } // namespace performance_monitor 465 } // 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