Commit f9b30cc6 authored by Harley Li's avatar Harley Li Committed by Commit Bot

[DevTools] Move opaque response explanatory link to 'clear storage' view

The original palce of that link is in service worker cache table, but
it makes more sense to have that link in the 'clear cache' view, since
the user is probably looking at the latter when they got an exception
about cache quota exceeding, which is probably caused by caching an
opaque response (UI meeting 11/07).

Bug: 847462
Change-Id: I99b039fc5b9617c1d0f4493dc3accce32d0385b3
Reviewed-on: https://chromium-review.googlesource.com/c/1325083Reviewed-by: default avatarErik Luo <luoe@chromium.org>
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612425}
parent 6df9a310
......@@ -36,6 +36,11 @@ Resources.ClearStorageView = class extends UI.ThrottledWidget {
const quota = this._reportView.appendSection(Common.UIString('Usage'));
this._quotaRow = quota.appendRow();
const learnMoreRow = quota.appendRow();
const learnMore = UI.XLink.create(
'https://developers.google.com/web/tools/chrome-devtools/progressive-web-apps#opaque-responses',
ls`Learn more`);
learnMoreRow.appendChild(learnMore);
this._quotaUsage = null;
this._pieChart = new PerfUI.PieChart(110, Number.bytesToString, true);
this._pieChartLegend = createElement('div');
......
......@@ -358,19 +358,12 @@ Resources.ServiceWorkerCacheView.DataGridNode = class extends DataGrid.DataGridN
if (columnId === 'path') {
value = this._path;
} else if (columnId === 'responseType') {
if (this._responseType === 'opaqueResponse') {
const opaque = UI.XLink.create(
'https://developers.google.com/web/tools/chrome-devtools/progressive-web-apps#opaque-responses',
ls`opaque`);
opaque.title = ls`As a security consideration, an opaque response potentially takes ` +
ls`up far more cache space than its content length`;
cell.appendChild(opaque);
return cell;
} else if (this._responseType === 'opaqueRedirect') {
if (this._responseType === 'opaqueResponse')
value = 'opaque';
else if (this._responseType === 'opaqueRedirect')
value = 'opaqueredirect';
} else {
else
value = this._responseType;
}
} else if (columnId === 'contentType') {
value = this._request.mimeType;
} else if (columnId === 'contentLength') {
......
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