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.
Comment 1 by momohatt@google.com
, Sep 10