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

Unified Diff: extensions/browser/event_router.cc

Issue 1606943005: Adds UMA for counting component event page wakeups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use std::move properly Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/event_router.cc
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index c16a0d5534cd1828c70d7ac0a0ff237ef70c5493..0f56fe73906162c79954e2d72bb997f1d350299e 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -760,10 +760,12 @@ void EventRouter::ReportEvent(events::HistogramValue histogram_value,
UMA_HISTOGRAM_ENUMERATION("Extensions.Events.Dispatch", histogram_value,
events::ENUM_BOUNDARY);
+ bool is_component = Manifest::IsComponentLocation(extension->location());
+
// Record events for component extensions. These should be kept to a minimum,
// especially if they wake its event page. Component extensions should use
// declarative APIs as much as possible.
- if (Manifest::IsComponentLocation(extension->location())) {
+ if (is_component) {
UMA_HISTOGRAM_ENUMERATION("Extensions.Events.DispatchToComponent",
histogram_value, events::ENUM_BOUNDARY);
}
@@ -788,6 +790,11 @@ void EventRouter::ReportEvent(events::HistogramValue histogram_value,
UMA_HISTOGRAM_ENUMERATION(
"Extensions.Events.DispatchWithSuspendedEventPage", histogram_value,
events::ENUM_BOUNDARY);
+ if (is_component) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Extensions.Events.DispatchToComponentWithSuspendedEventPage",
+ histogram_value, events::ENUM_BOUNDARY);
+ }
} else {
UMA_HISTOGRAM_ENUMERATION(
"Extensions.Events.DispatchWithRunningEventPage", histogram_value,
« no previous file with comments | « no previous file | extensions/browser/event_router_unittest.cc » ('j') | extensions/browser/event_router_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698