New issue
Advanced search Search tips

Issue 727922 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature


Participants' hotlists:
OWP-Storage-DevTools


Sign in to add a comment

[CacheStorage] [DevTools] Add 'time saved' or 'time received' to cache storage data grid.

Project Member Reported by dmu...@chromium.org, May 30 2017

Issue description

It would be super helpful to see when a response was saved to cache storage. We can add this to the data grid.
 

Comment 1 by dmu...@chromium.org, May 30 2017

Labels: -Type-Bug Type-Feature
Here is the inspector agent for cache storage:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.h?q=cachestorage+inspector+agent&dr=CSs&l=29


Here is where we request entries:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=441

Which starts (after openning the cache) by asking for all keys (which are 'request' objects):
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=313

We passed a callback to that request, which onsuccess we fetch all responses:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=268
and
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=282

which we add to an accumulator:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=182

You can do a trivial change by modifying this line:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp?dr=CSs&l=188

To get the ResponseTime instead of the status text:
https://cs.chromium.org/chromium/src/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponse.h?dr=CSs&l=78



Preferably we want to update the protocol here between devtools and c++, so instead of a DataEntry with a string request and string response, we can also have number for the responsetime in milliseconds.


Or, you can even just pass the whole Response object back - might require a little more wiring in the protocol.

Ask a devtools person about modifying the protocol for that route.


Components: -Platform>Apps>DevTools Platform>DevTools
Started the CL here:
https://codereview.chromium.org/2928833002/

Screenshot of the current changes is attached. Time is currently displayed in the 24h format.
Screenshot from 2017-06-07 13:55:19.png
65.6 KB View Download
Updated timestamp formatting
Screenshot from 2017-06-07 15:36:57.png
66.6 KB View Download
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7

commit d3ec2cc58603cc0578e7f3f17ddba5ff768303a7
Author: kristipark <kristipark@chromium.org>
Date: Mon Jun 12 22:42:23 2017

[CacheStorage] [DevTools] Added "Time Received" column to cache storage data grid

Screenshot of the change in the bug.

Since the entry response time is given as an internal UTC format, I added wrapper methods to Time.h to convert it to standard UTC format.

BUG= 727922 

Review-Url: https://codereview.chromium.org/2928833002
Cr-Commit-Position: refs/heads/master@{#478797}

[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-data.html
[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js
[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/Source/core/inspector/browser_protocol.json
[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js
[modify] https://crrev.com/d3ec2cc58603cc0578e7f3f17ddba5ff768303a7/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp

Status: Fixed (was: Assigned)

Comment 8 by kayce@google.com, Jun 16 2017

Labels: DevTools-Release-Notes-Feature

Comment 9 by kayce@google.com, Jul 6 2017

Labels: DevTools-Release-Notes-61

Sign in to add a comment