Jotting down the conclusions of a discussion on code simplification with peter@ and rayankans@ here, for Q3:
We're currently maintaining the state for a Background Fetch in multiple components across various layers in code. This makes for a hard to understand, and fragile codebase. Here are the three things we agreed will make this better:
1. Move all knowledge of ongoing fetches (active + pending) to the scheduler. This can be done by moving controllers to it, in one or more containers (one for active fetches, one for pending ones).
2. Make the scheduler an observer of data_manager updates. This decouples the context from the scheduler, and allows the scheduler to automatically pick up any new pending fetches for processing.
3. Make the delegate in chrome layer just a proxy, which allows the download service and offline_items_collection code to talk to the code in the content layer. This simplifies the logic in the delegate and allows it to focus on chrome specific logic.
|
Deleted:
nator_s_Jam.pdf
895 KB
|
Comment 1 by rayankans@chromium.org
, Jun 7 2018