Skip to content

Commit

Permalink
Remove obsolete download security metrics
Browse files Browse the repository at this point in the history
Download.Started.ContentType.InsecureChain and
Download.Started.ContentType.SecureChain have been superseded by the
new mixed downloads metrics under Download.InsecureBlocking, so this
marks the old histograms as obsolete and removes the collection code.

Bug: 1063890
Change-Id: I957d55299c302a3e49b5be5923180858eec1a007
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140296
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757470}
  • Loading branch information
christhompson authored and Commit Bot committed Apr 8, 2020
1 parent b754cf3 commit 7d18d8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 38 deletions.
26 changes: 0 additions & 26 deletions components/download/internal/common/download_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -734,32 +734,6 @@ void RecordDownloadValidationMetrics(DownloadMetricsCallsite callsite,
DownloadContent::MAX);
}

void RecordDownloadContentTypeSecurity(
const GURL& download_url,
const std::vector<GURL>& url_chain,
const std::string& mime_type,
const base::RepeatingCallback<bool(const GURL&)>&
is_origin_secure_callback) {
bool is_final_download_secure = is_origin_secure_callback.Run(download_url);
bool is_redirect_chain_secure = true;
for (const auto& url : url_chain) {
if (!is_origin_secure_callback.Run(url)) {
is_redirect_chain_secure = false;
break;
}
}

DownloadContent download_content =
download::DownloadContentFromMimeType(mime_type, false);
if (is_final_download_secure && is_redirect_chain_secure) {
UMA_HISTOGRAM_ENUMERATION("Download.Start.ContentType.SecureChain",
download_content, DownloadContent::MAX);
} else {
UMA_HISTOGRAM_ENUMERATION("Download.Start.ContentType.InsecureChain",
download_content, DownloadContent::MAX);
}
}

void RecordDownloadSourcePageTransitionType(
const base::Optional<ui::PageTransition>& page_transition) {
if (!page_transition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,6 @@ void InProgressDownloadManager::StartDownload(
std::vector<GURL> url_chain = info->url_chain;
std::string mime_type = info->mime_type;

if (info->is_new_download) {
RecordDownloadContentTypeSecurity(info->url(), info->url_chain,
info->mime_type, is_origin_secure_cb_);
}

// If the download cannot be found locally, ask |delegate_| to provide the
// DownloadItem.
if (delegate_ && !GetDownloadByGuid(info->guid)) {
Expand Down
7 changes: 0 additions & 7 deletions components/download/public/common/download_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,6 @@ COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadConnectionSecurity(
const GURL& download_url,
const std::vector<GURL>& url_chain);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadContentTypeSecurity(
const GURL& download_url,
const std::vector<GURL>& url_chain,
const std::string& mime_type,
const base::RepeatingCallback<bool(const GURL&)>&
is_origin_secure_callback);

COMPONENTS_DOWNLOAD_EXPORT void RecordDownloadSourcePageTransitionType(
const base::Optional<ui::PageTransition>& transition);

Expand Down
8 changes: 8 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43063,6 +43063,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.

<histogram name="Download.Start.ContentType.InsecureChain"
enum="DownloadContentType" expires_after="2020-09-06">
<obsolete>
Removed in 04/2020. Superseded by mixed download metrics under
Download.InsecureBlocking.
</obsolete>
<owner>cthomp@chromium.org</owner>
<owner>estark@chromium.org</owner>
<summary>
Expand All @@ -43086,6 +43090,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.

<histogram name="Download.Start.ContentType.SecureChain"
enum="DownloadContentType" expires_after="2020-05-03">
<obsolete>
Removed in 04/2020. Superseded by mixed download metrics under
Download.InsecureBlocking.
</obsolete>
<owner>cthomp@chromium.org</owner>
<owner>estark@chromium.org</owner>
<summary>
Expand Down

0 comments on commit 7d18d8e

Please sign in to comment.