Commit 82a2dd34 authored by Ben Kelly's avatar Ben Kelly Committed by Commit Bot

Display "(from memory cache)" when loading ServiceWorker-produced resources from memory cache.

Bug: 881961
Change-Id: Ie58d071b3a80f48274991eaed799fc144da1d6a1
Reviewed-on: https://chromium-review.googlesource.com/1214046Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590358}
parent 54a733da
......@@ -951,17 +951,17 @@ Network.NetworkRequestNode = class extends Network.NetworkNode {
* @param {!Element} cell
*/
_renderSizeCell(cell) {
if (this._request.fetchedViaServiceWorker) {
if (this._request.cachedInMemory()) {
this._setTextAndTitle(cell, Common.UIString('(from memory cache)'));
cell.classList.add('network-dim-cell');
} else if (this._request.fetchedViaServiceWorker) {
this._setTextAndTitle(cell, Common.UIString('(from ServiceWorker)'));
cell.classList.add('network-dim-cell');
} else if (this._request.redirectSource() && this._request.redirectSource().signedExchangeInfo()) {
this._setTextAndTitle(cell, Common.UIString('(from signed-exchange)'));
cell.classList.add('network-dim-cell');
} else if (this._request.cached()) {
if (this._request.cachedInMemory())
this._setTextAndTitle(cell, Common.UIString('(from memory cache)'));
else
this._setTextAndTitle(cell, Common.UIString('(from disk cache)'));
this._setTextAndTitle(cell, Common.UIString('(from disk cache)'));
cell.classList.add('network-dim-cell');
} else {
const resourceSize = Number.bytesToString(this._request.resourceSize);
......
......@@ -393,17 +393,17 @@ Network.RequestHeadersView = class extends UI.VBox {
const statusTextElement = statusCodeFragment.createChild('div', 'header-value source-code');
let statusText = this._request.statusCode + ' ' + this._request.statusText;
if (this._request.fetchedViaServiceWorker) {
if (this._request.cachedInMemory()) {
statusText += ' ' + Common.UIString('(from memory cache)');
statusTextElement.classList.add('status-from-cache');
} else if (this._request.fetchedViaServiceWorker) {
statusText += ' ' + Common.UIString('(from ServiceWorker)');
statusTextElement.classList.add('status-from-cache');
} else if (this._request.redirectSource() && this._request.redirectSource().signedExchangeInfo()) {
statusText += ' ' + Common.UIString('(from signed-exchange)');
statusTextElement.classList.add('status-from-cache');
} else if (this._request.cached()) {
if (this._request.cachedInMemory())
statusText += ' ' + Common.UIString('(from memory cache)');
else
statusText += ' ' + Common.UIString('(from disk cache)');
statusText += ' ' + Common.UIString('(from disk cache)');
statusTextElement.classList.add('status-from-cache');
}
statusTextElement.textContent = statusText;
......
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