New issue
Advanced search Search tips

Issue 882359 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 23
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Refine code of ServiceWorkerCacheWriter and its unittest

Project Member Reported by momohatt@google.com, Sep 10

Issue description

Current implementation of ServiceWorkerCacheWriter is difficult to understand. This is partly due to its use of an internal state machine, which is making the flow of the execution harder to trace. We can refactor these by simply calling the next procedure within the previous one and not going back to the DoLoop() every time.
Also, some old unit tests of ServiceWorkerCacheWriter lacks readability because its data structure is not straightforward and it doesn't have any comments. Newer tests have established a way to improve readability, so the older tests should be refactored following the newer ones.
 
Labels: -OS-Linux -OS-Android -OS-Windows -OS-iOS -OS-Chrome -OS-Mac -OS-Fuchsia
Status: Available (was: Untriaged)
Status: WontFix (was: Available)
I'm not sure I agree with this bug. This code was written to match the DoLoop idiom used in the net stack (e.g., for the http cache) at https://codereview.chromium.org/1315443003.

See e.g., https://cs.chromium.org/search/?q=DoLoop&sq=package:chromium&type=cs

The suggestion to add comments to unit tests is good but I don't think we need a bug open for it. 

Sign in to add a comment