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