The current responsibilities that SnapshotController has are much simpler than it used to be. It does:
* Keeps information on current page quality by monitoring page loading.
* Notifies its clients when it considers that the page quality changed to another level.
But it is currently doing more than that: it also keeps track of ongoing snapshot creations. None of its clients need that functionality anymore so it should be now removed.
The overall changes for this refactor should be:
* SnapshotController is not a controller anymore and its name should be changed accordingly (SnapshotMonitor? SnapshostSignalEmitter?)
* Remove:
** methods SnapshotController::Stop, Reset and PendingSnapshotCompleted
** enum SnapshotController::State
** Related internal members and logic.
* Refactor SnapshotController::Client::StartSnapshot() so that it returns a boolean that indicates if the client is still interested in receiving further StartSnapshot calls. It might make sense to rename it too.
** Update all clients accordingly.
* RecentTabHelper should create new instances of SnapshotController per navigation, when needed.
* Updates affected tests.
Comment 1 by fgor...@chromium.org
, Apr 23 2017Owner: chili@chromium.org
Status: Assigned (was: Available)