Commit 470b3b91 authored by Rudy Xie's avatar Rudy Xie Committed by Commit Bot

Add a DownloadService client needed by downstream

This client is needed by downstream (Mountain) repo.

Bug: b/75308868
Change-Id: I06829202017f8244db7787ff0cb3f09b01662032
Reviewed-on: https://chromium-review.googlesource.com/972224Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Rudy Xie <rudyxie@google.com>
Cr-Commit-Position: refs/heads/master@{#545005}
parent dfda94d7
...@@ -53,6 +53,8 @@ std::string ClientToString(DownloadClient client) { ...@@ -53,6 +53,8 @@ std::string ClientToString(DownloadClient client) {
return "BackgroundFetch"; return "BackgroundFetch";
case DownloadClient::DEBUGGING: case DownloadClient::DEBUGGING:
return "Debugging"; return "Debugging";
case DownloadClient::MOUNTAIN_INTERNAL:
return "MountainInternal";
case DownloadClient::BOUNDARY: // Intentional fallthrough. case DownloadClient::BOUNDARY: // Intentional fallthrough.
default: default:
NOTREACHED(); NOTREACHED();
......
...@@ -21,7 +21,8 @@ enum DownloadClient { ...@@ -21,7 +21,8 @@ enum DownloadClient {
OFFLINE_PAGE_PREFETCH = 4; OFFLINE_PAGE_PREFETCH = 4;
BACKGROUND_FETCH = 5; BACKGROUND_FETCH = 5;
DEBUGGING = 6; DEBUGGING = 6;
BOUNDARY = 7; MOUNTAIN_INTERNAL = 7;
BOUNDARY = 8;
} }
// Stores the request params, internal state, metrics and metadata associated // Stores the request params, internal state, metrics and metadata associated
......
...@@ -68,6 +68,8 @@ protodb::DownloadClient ProtoConversions::DownloadClientToProto( ...@@ -68,6 +68,8 @@ protodb::DownloadClient ProtoConversions::DownloadClientToProto(
return protodb::DownloadClient::BACKGROUND_FETCH; return protodb::DownloadClient::BACKGROUND_FETCH;
case DownloadClient::DEBUGGING: case DownloadClient::DEBUGGING:
return protodb::DownloadClient::DEBUGGING; return protodb::DownloadClient::DEBUGGING;
case DownloadClient::MOUNTAIN_INTERNAL:
return protodb::DownloadClient::MOUNTAIN_INTERNAL;
case DownloadClient::BOUNDARY: case DownloadClient::BOUNDARY:
return protodb::DownloadClient::BOUNDARY; return protodb::DownloadClient::BOUNDARY;
} }
...@@ -93,6 +95,8 @@ DownloadClient ProtoConversions::DownloadClientFromProto( ...@@ -93,6 +95,8 @@ DownloadClient ProtoConversions::DownloadClientFromProto(
return DownloadClient::BACKGROUND_FETCH; return DownloadClient::BACKGROUND_FETCH;
case protodb::DownloadClient::DEBUGGING: case protodb::DownloadClient::DEBUGGING:
return DownloadClient::DEBUGGING; return DownloadClient::DEBUGGING;
case protodb::DownloadClient::MOUNTAIN_INTERNAL:
return DownloadClient::MOUNTAIN_INTERNAL;
case protodb::DownloadClient::BOUNDARY: case protodb::DownloadClient::BOUNDARY:
return DownloadClient::BOUNDARY; return DownloadClient::BOUNDARY;
} }
......
...@@ -91,6 +91,8 @@ std::string ClientToHistogramSuffix(DownloadClient client) { ...@@ -91,6 +91,8 @@ std::string ClientToHistogramSuffix(DownloadClient client) {
return "BackgroundFetch"; return "BackgroundFetch";
case DownloadClient::DEBUGGING: case DownloadClient::DEBUGGING:
return "Debugging"; return "Debugging";
case DownloadClient::MOUNTAIN_INTERNAL:
return "MountainInternal";
case DownloadClient::BOUNDARY: case DownloadClient::BOUNDARY:
NOTREACHED(); NOTREACHED();
break; break;
......
...@@ -37,7 +37,9 @@ enum class DownloadClient { ...@@ -37,7 +37,9 @@ enum class DownloadClient {
// Used by debug surfaces in the app (the WebUI, for example). // Used by debug surfaces in the app (the WebUI, for example).
DEBUGGING = 3, DEBUGGING = 3,
BOUNDARY = 4, MOUNTAIN_INTERNAL = 4,
BOUNDARY = 5,
}; };
using DownloadClientMap = std::map<DownloadClient, std::unique_ptr<Client>>; using DownloadClientMap = std::map<DownloadClient, std::unique_ptr<Client>>;
......
...@@ -106924,6 +106924,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -106924,6 +106924,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<suffix name="OfflinePage" label="Offline page prefetch."/> <suffix name="OfflinePage" label="Offline page prefetch."/>
<suffix name="BackgroundFetch" label="Background fetch."/> <suffix name="BackgroundFetch" label="Background fetch."/>
<suffix name="Debugging" label="Debugging client."/> <suffix name="Debugging" label="Debugging client."/>
<suffix name="MountainInternal" label="Mountain internal client."/>
<affected-histogram name="Download.Service.Request.ClientAction"/> <affected-histogram name="Download.Service.Request.ClientAction"/>
<affected-histogram name="Download.Service.Request.StartResponse"/> <affected-histogram name="Download.Service.Request.StartResponse"/>
<affected-histogram name="Download.Service.Request.StartResult"/> <affected-histogram name="Download.Service.Request.StartResult"/>
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