| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |