New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714340 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit 22 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Simplify SnapshotController to make it not a controller anymore

Project Member Reported by carlosk@chromium.org, Apr 22 2017

Issue description

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.
 
Cc: -chili@chromium.org fgor...@chromium.org
Owner: chili@chromium.org
Status: Assigned (was: Available)
Cathy is already working on a refactoring of snapshot controller and its relationship to consumers and these are definitely good ideas to factor in, when doing that work.

I am not thrilled about a name change, but we can discuss that as well.

Given the scope of work, don't consider this a Fixit effort. After all it is our Q2 OKR.

Sign in to add a comment