Download source enum for download better metrics.
This CL introduces a new enum that track the download source.
Currently it lives in content/public/browser, and passed in from
content::DownloadUrlParameters. In components/download, there is a one
to one mapping enum for usage in download in progress db, which can not
depend on content/public.
This enum is supposed to used in UMA as suffix for several key metrics
and UKM as Components, and saved in the new in progress level db.
Bug: 786482
Change-Id: I19a2f959eb9e7b0787087cad6c9519acbde13281
Reviewed-on: https://chromium-review.googlesource.com/777548
Commit-Queue: Xing Liu <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: Min Qin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#519928}
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 837b3c9..f8830e1 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -980,8 +980,9 @@
download::InProgressCache* in_progress_cache =
GetBrowserContext()->GetDownloadManagerDelegate()->GetInProgressCache();
if (in_progress_cache) {
- in_progress_cache->AddOrReplaceEntry(download::DownloadEntry(
- params.get()->guid(), params.get()->request_origin()));
+ in_progress_cache->AddOrReplaceEntry(
+ download::DownloadEntry(params->guid(), params->request_origin(),
+ ToDownloadSource(params->download_source())));
}
if (base::FeatureList::IsEnabled(features::kNetworkService)) {