Reland: Make future changes to PrefetchItemState elements safer.
Introduce new code patterns to improve the likeliness that future changes to the elements of PrefetchItemState will be properly handled. A new |kOrderedPrefetchItemStates| complements the enum definition by providing the full listing of existing states. A new test also checks that changes to the enum are reflected in this listing. The implementation of GetAllStatesExcept was updated to use this official state list and accept a collection of states to filter from its result. New calls to this function were also added from tests where created a local listing of arbitrary states, what should guarantee that new or changed state values would have to be dealt with. Finally uses of `default` in switch blocks for PrefetchItemState were replaced with the full listing of all possible states so that build errors would guide the proper handling of all states. Original CL: https://crrev.com/c/937944 Revert CL: https://crrev.com/c/942561 The original CL passed CQ but broke an iOS build, what should be fixed here. TBR: dewittj@chromium.org, harringtond@chromium.org Bug: 701939 Change-Id: I11eead58013180f17104738352dee23921a815dc Reviewed-on: https://chromium-review.googlesource.com/944716Reviewed-by:Carlos Knippschild <carlosk@chromium.org> Reviewed-by:
Justin DeWitt <dewittj@chromium.org> Commit-Queue: Carlos Knippschild <carlosk@chromium.org> Cr-Commit-Position: refs/heads/master@{#540383}
Showing
Please register or sign in to comment