Commit 687cff71 authored by Jeff Cyr's avatar Jeff Cyr Committed by Chromium LUCI CQ

Add histograms for Enhanced Safe Browsing CRX allowlist

Add histograms to count the number enabled and disabled extensions that
are not present in the Enhanced Safe Browsing CRX allowlist per profile.
The metrics are separated for all users versus Enhanced Safe Browsing
users.

Bug: 1153873
Change-Id: I84f167042fe63299b8da0669c9d117bf136090e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627827
Commit-Queue: Jeff Cyr <jeffcyr@google.com>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843932}
parent 62ad864c
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "extensions/browser/allowlist_state.h"
#include "extensions/browser/event_router.h" #include "extensions/browser/event_router.h"
#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
...@@ -370,6 +371,8 @@ void InstalledLoader::RecordExtensionsMetrics() { ...@@ -370,6 +371,8 @@ void InstalledLoader::RecordExtensionsMetrics() {
int off_store_item_count = 0; int off_store_item_count = 0;
int web_request_blocking_count = 0; int web_request_blocking_count = 0;
int web_request_count = 0; int web_request_count = 0;
int enabled_not_allowlisted_count = 0;
int disabled_not_allowlisted_count = 0;
const ExtensionSet& extensions = extension_registry_->enabled_extensions(); const ExtensionSet& extensions = extension_registry_->enabled_extensions();
for (ExtensionSet::const_iterator iter = extensions.begin(); for (ExtensionSet::const_iterator iter = extensions.begin();
...@@ -600,6 +603,12 @@ void InstalledLoader::RecordExtensionsMetrics() { ...@@ -600,6 +603,12 @@ void InstalledLoader::RecordExtensionsMetrics() {
num_granted_hosts); num_granted_hosts);
} }
} }
if (extension_prefs_->GetExtensionAllowlistState(extension->id()) ==
ALLOWLIST_NOT_ALLOWLISTED) {
// Record the number of not allowlisted enabled extensions.
++enabled_not_allowlisted_count;
}
} }
const ExtensionSet& disabled_extensions = const ExtensionSet& disabled_extensions =
...@@ -624,6 +633,12 @@ void InstalledLoader::RecordExtensionsMetrics() { ...@@ -624,6 +633,12 @@ void InstalledLoader::RecordExtensionsMetrics() {
EXTERNAL_ITEM_MAX_ITEMS); EXTERNAL_ITEM_MAX_ITEMS);
} }
} }
if (extension_prefs_->GetExtensionAllowlistState((*ex)->id()) ==
ALLOWLIST_NOT_ALLOWLISTED) {
// Record the number of not allowlisted disabled extensions.
++disabled_not_allowlisted_count;
}
} }
base::UmaHistogramCounts100("Extensions.LoadApp", base::UmaHistogramCounts100("Extensions.LoadApp",
...@@ -684,6 +699,16 @@ void InstalledLoader::RecordExtensionsMetrics() { ...@@ -684,6 +699,16 @@ void InstalledLoader::RecordExtensionsMetrics() {
base::UmaHistogramCounts100("Extensions.WebRequestBlockingCount", base::UmaHistogramCounts100("Extensions.WebRequestBlockingCount",
web_request_blocking_count); web_request_blocking_count);
base::UmaHistogramCounts100("Extensions.WebRequestCount", web_request_count); base::UmaHistogramCounts100("Extensions.WebRequestCount", web_request_count);
base::UmaHistogramCounts100("Extensions.NotAllowlistedEnabled",
enabled_not_allowlisted_count);
base::UmaHistogramCounts100("Extensions.NotAllowlistedDisabled",
disabled_not_allowlisted_count);
if (safe_browsing::IsEnhancedProtectionEnabled(*profile->GetPrefs())) {
base::UmaHistogramCounts100("Extensions.NotAllowlistedEnabledAndEsbUser",
enabled_not_allowlisted_count);
base::UmaHistogramCounts100("Extensions.NotAllowlistedDisabledAndEsbUser",
disabled_not_allowlisted_count);
}
} }
int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
......
...@@ -2776,6 +2776,50 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -2776,6 +2776,50 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Extensions.NotAllowlistedDisabled" units="extensions"
expires_after="2021-06-01">
<owner>jeffcyr@google.com</owner>
<owner>lucferron@chromium.org</owner>
<summary>
The total number of disabled extensions that are not present in the Enhanced
Safe Browsing CRX allowlist. Recorded for all users on profile
initialization.
</summary>
</histogram>
<histogram name="Extensions.NotAllowlistedDisabledAndEsbUser"
units="extensions" expires_after="2021-06-01">
<owner>jeffcyr@google.com</owner>
<owner>lucferron@chromium.org</owner>
<summary>
The total number of disabled extensions that are not present in the Enhanced
Safe Browsing CRX allowlist. Recorded for only for Enhanced Safe Browsing
users on profile initialization.
</summary>
</histogram>
<histogram name="Extensions.NotAllowlistedEnabled" units="extensions"
expires_after="2021-06-01">
<owner>jeffcyr@google.com</owner>
<owner>lucferron@chromium.org</owner>
<summary>
The total number of enabled extensions that are not present in the Enhanced
Safe Browsing CRX allowlist. Recorded for all users on profile
initialization.
</summary>
</histogram>
<histogram name="Extensions.NotAllowlistedEnabledAndEsbUser" units="extensions"
expires_after="2021-06-01">
<owner>jeffcyr@google.com</owner>
<owner>lucferron@chromium.org</owner>
<summary>
The total number of enabled extensions that are not present in the Enhanced
Safe Browsing CRX allowlist. Recorded for only for Enhanced Safe Browsing
users on profile initialization.
</summary>
</histogram>
<histogram name="Extensions.Permissions_AutoDisable3" <histogram name="Extensions.Permissions_AutoDisable3"
enum="ExtensionPermission3" expires_after="2020-12-01"> enum="ExtensionPermission3" expires_after="2020-12-01">
<owner>rdevlin.cronin@chromium.org</owner> <owner>rdevlin.cronin@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment