| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 // Start our periodic gathering of metrics. | 223 // Start our periodic gathering of metrics. |
| 224 if (!disable_timer_autostart_for_testing_) | 224 if (!disable_timer_autostart_for_testing_) |
| 225 timer_.Reset(); | 225 timer_.Reset(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void PerformanceMonitor::RegisterForNotifications() { | 228 void PerformanceMonitor::RegisterForNotifications() { |
| 229 DCHECK(database_logging_enabled_); | 229 DCHECK(database_logging_enabled_); |
| 230 | 230 |
| 231 // Extensions | 231 // Extensions |
| 232 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, | 232 registrar_.Add(this, |
| 233 content::NotificationService::AllSources()); | 233 chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED, |
| 234 content::NotificationService::AllSources()); |
| 234 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, | 235 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, |
| 235 content::NotificationService::AllSources()); | 236 content::NotificationService::AllSources()); |
| 236 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 237 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 237 content::NotificationService::AllSources()); | 238 content::NotificationService::AllSources()); |
| 238 registrar_.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 239 registrar_.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 239 content::NotificationService::AllSources()); | 240 content::NotificationService::AllSources()); |
| 240 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 241 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
| 241 content::NotificationService::AllSources()); | 242 content::NotificationService::AllSources()); |
| 242 | 243 |
| 243 // Crashes | 244 // Crashes |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 if (initialized_ && !request.url().SchemeIsFile()) | 548 if (initialized_ && !request.url().SchemeIsFile()) |
| 548 performance_data_for_io_thread_.network_bytes_read += bytes_read; | 549 performance_data_for_io_thread_.network_bytes_read += bytes_read; |
| 549 } | 550 } |
| 550 | 551 |
| 551 void PerformanceMonitor::Observe(int type, | 552 void PerformanceMonitor::Observe(int type, |
| 552 const content::NotificationSource& source, | 553 const content::NotificationSource& source, |
| 553 const content::NotificationDetails& details) { | 554 const content::NotificationDetails& details) { |
| 554 DCHECK(database_logging_enabled_); | 555 DCHECK(database_logging_enabled_); |
| 555 | 556 |
| 556 switch (type) { | 557 switch (type) { |
| 557 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { | 558 case chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED: { |
| 558 AddExtensionEvent( | 559 AddExtensionEvent( |
| 559 EVENT_EXTENSION_INSTALL, | 560 EVENT_EXTENSION_INSTALL, |
| 560 content::Details<const extensions::InstalledExtensionInfo>(details)-> | 561 content::Details<const extensions::InstalledExtensionInfo>(details)-> |
| 561 extension); | 562 extension); |
| 562 break; | 563 break; |
| 563 } | 564 } |
| 564 case chrome::NOTIFICATION_EXTENSION_ENABLED: { | 565 case chrome::NOTIFICATION_EXTENSION_ENABLED: { |
| 565 AddExtensionEvent(EVENT_EXTENSION_ENABLE, | 566 AddExtensionEvent(EVENT_EXTENSION_ENABLE, |
| 566 content::Details<Extension>(details).ptr()); | 567 content::Details<Extension>(details).ptr()); |
| 567 break; | 568 break; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 if (!url_list.empty()) | 704 if (!url_list.empty()) |
| 704 url_list += ", "; | 705 url_list += ", "; |
| 705 | 706 |
| 706 url_list += url; | 707 url_list += url; |
| 707 } | 708 } |
| 708 | 709 |
| 709 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); | 710 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); |
| 710 } | 711 } |
| 711 | 712 |
| 712 } // namespace performance_monitor | 713 } // namespace performance_monitor |
| OLD | NEW |