Commit 5b14716c authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Add UMA metrics for Deep Scanning of Paste uploads

Bug: 1020267
Change-Id: I98f1a6b785f66225622bacd60721bd84e3d508d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2005688Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732888}
parent bae9a019
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
#include "chrome/browser/resource_coordinator/background_tab_navigation_throttle.h" #include "chrome/browser/resource_coordinator/background_tab_navigation_throttle.h"
#include "chrome/browser/safe_browsing/certificate_reporting_service.h" #include "chrome/browser/safe_browsing/certificate_reporting_service.h"
#include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#include "chrome/browser/safe_browsing/safe_browsing_navigation_throttle.h" #include "chrome/browser/safe_browsing/safe_browsing_navigation_throttle.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/safe_browsing/ui_manager.h" #include "chrome/browser/safe_browsing/ui_manager.h"
...@@ -5478,7 +5479,8 @@ void ChromeContentBrowserClient::IsClipboardPasteAllowed( ...@@ -5478,7 +5479,8 @@ void ChromeContentBrowserClient::IsClipboardPasteAllowed(
std::move(callback).Run( std::move(callback).Run(
ClipboardPasteAllowed(result.text_results[0])); ClipboardPasteAllowed(result.text_results[0]));
}, },
std::move(callback))); std::move(callback)),
safe_browsing::DeepScanAccessPoint::PASTE);
} else { } else {
std::move(callback).Run(ClipboardPasteAllowed(true)); std::move(callback).Run(ClipboardPasteAllowed(true));
} }
......
...@@ -87,7 +87,6 @@ void MaybeReportDeepScanningVerdict(Profile* profile, ...@@ -87,7 +87,6 @@ void MaybeReportDeepScanningVerdict(Profile* profile,
} }
std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point) { std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point) {
// TODO(domfc): Add PASTE access point.
switch (access_point) { switch (access_point) {
case DeepScanAccessPoint::DOWNLOAD: case DeepScanAccessPoint::DOWNLOAD:
return "Download"; return "Download";
...@@ -95,6 +94,8 @@ std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point) { ...@@ -95,6 +94,8 @@ std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point) {
return "Upload"; return "Upload";
case DeepScanAccessPoint::DRAG_AND_DROP: case DeepScanAccessPoint::DRAG_AND_DROP:
return "DragAndDrop"; return "DragAndDrop";
case DeepScanAccessPoint::PASTE:
return "Paste";
} }
NOTREACHED(); NOTREACHED();
return ""; return "";
......
...@@ -32,11 +32,11 @@ void MaybeReportDeepScanningVerdict(Profile* profile, ...@@ -32,11 +32,11 @@ void MaybeReportDeepScanningVerdict(Profile* profile,
// "SafeBrowsing.DeepScan.<access-point>.BytesPerSeconds" // "SafeBrowsing.DeepScan.<access-point>.BytesPerSeconds"
// "SafeBrowsing.DeepScan.<access-point>.Duration" // "SafeBrowsing.DeepScan.<access-point>.Duration"
// "SafeBrowsing.DeepScan.<access-point>.<result>.Duration" // "SafeBrowsing.DeepScan.<access-point>.<result>.Duration"
// TODO(domfc): Add PASTE access point.
enum class DeepScanAccessPoint { enum class DeepScanAccessPoint {
DOWNLOAD, DOWNLOAD,
UPLOAD, UPLOAD,
DRAG_AND_DROP, DRAG_AND_DROP,
PASTE,
}; };
std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point); std::string DeepScanAccessPointToString(DeepScanAccessPoint access_point);
......
...@@ -100,7 +100,8 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -100,7 +100,8 @@ INSTANTIATE_TEST_SUITE_P(
DeepScanningUtilsUMATest, DeepScanningUtilsUMATest,
testing::Combine(testing::Values(DeepScanAccessPoint::DOWNLOAD, testing::Combine(testing::Values(DeepScanAccessPoint::DOWNLOAD,
DeepScanAccessPoint::UPLOAD, DeepScanAccessPoint::UPLOAD,
DeepScanAccessPoint::DRAG_AND_DROP), DeepScanAccessPoint::DRAG_AND_DROP,
DeepScanAccessPoint::PASTE),
testing::ValuesIn(kAllBinaryUploadServiceResults))); testing::ValuesIn(kAllBinaryUploadServiceResults)));
TEST_P(DeepScanningUtilsUMATest, SuccessfulScanVerdicts) { TEST_P(DeepScanningUtilsUMATest, SuccessfulScanVerdicts) {
......
...@@ -129095,6 +129095,101 @@ uploading your change for review. ...@@ -129095,6 +129095,101 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.BytesPerSeconds" units="bytes"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the bytes/sec from the size of a user paste request divided by
the duration of a successful deep scanning upload request. It is logged once
for each successful binary upload.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.CancelledByUser.Duration"
units="ms" expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the duration from the time the binary is uploaded for deep
scanning of a paste until the time the user decides to cancel the upload. It
is logged once for each binary upload when the user bypasses the verdict.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.Duration" units="ms"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request. It is
logged once for each binary upload.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.FailedToGetToken.Duration"
units="ms" expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with a
FailedToGetToken result. It is logged once for each binary upload with that
result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.FailedToGetVerdict.Duration"
units="ms" expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with a
non-successful scan verdict. It is logged once for each binary upload with
that result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.FileTooLarge.Duration" units="ms"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with a
FileTooLarge result. It is logged once for each binary upload with that
result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.Success.Duration" units="ms"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with a
Success result. It is logged once for each binary upload with that result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.Timeout.Duration" units="ms"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with a
Timeout result. It is logged once for each binary upload with that result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Paste.Unknown.Duration" units="ms"
expires_after="M85">
<owner>domfc@chromium.org</owner>
<owner>webprotect-team@google.com</owner>
<summary>
This records the deep scanning duration of a user paste request with an
Unknown result. It is logged once for each binary upload with that result.
</summary>
</histogram>
<histogram name="SafeBrowsing.DeepScan.Upload.BytesPerSeconds" units="bytes" <histogram name="SafeBrowsing.DeepScan.Upload.BytesPerSeconds" units="bytes"
expires_after="M85"> expires_after="M85">
<owner>domfc@chromium.org</owner> <owner>domfc@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