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/performance_monitor/performance_monitor.h" | 5 #include "chrome/browser/performance_monitor/performance_monitor.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 bool PerformanceMonitor::initialized_ = false; | 95 bool PerformanceMonitor::initialized_ = false; |
96 | 96 |
97 PerformanceMonitor::PerformanceDataForIOThread::PerformanceDataForIOThread() | 97 PerformanceMonitor::PerformanceDataForIOThread::PerformanceDataForIOThread() |
98 : network_bytes_read(0) { | 98 : network_bytes_read(0) { |
99 } | 99 } |
100 | 100 |
101 PerformanceMonitor::PerformanceMonitor() : database_(NULL), | 101 PerformanceMonitor::PerformanceMonitor() : metrics_map_(new MetricsMap) {} |
102 metrics_map_(new MetricsMap) { | |
103 } | |
104 | 102 |
105 PerformanceMonitor::~PerformanceMonitor() { | 103 PerformanceMonitor::~PerformanceMonitor() { |
106 BrowserThread::PostBlockingPoolSequencedTask( | 104 BrowserThread::PostBlockingPoolSequencedTask( |
107 Database::kDatabaseSequenceToken, | 105 Database::kDatabaseSequenceToken, |
108 FROM_HERE, | 106 FROM_HERE, |
109 base::Bind(&DeleteDatabaseOnBackgroundThread, database_.release())); | 107 base::Bind(&DeleteDatabaseOnBackgroundThread, database_.release())); |
110 } | 108 } |
111 | 109 |
112 bool PerformanceMonitor::SetDatabasePath(const base::FilePath& path) { | 110 bool PerformanceMonitor::SetDatabasePath(const base::FilePath& path) { |
113 if (!database_.get()) { | 111 if (!database_.get()) { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 if (!url_list.empty()) | 642 if (!url_list.empty()) |
645 url_list += ", "; | 643 url_list += ", "; |
646 | 644 |
647 url_list += url; | 645 url_list += url; |
648 } | 646 } |
649 | 647 |
650 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); | 648 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); |
651 } | 649 } |
652 | 650 |
653 } // namespace performance_monitor | 651 } // namespace performance_monitor |
OLD | NEW |