[css-grid] Return cached track sizes by reference
Currently GridTrackSizingAlgorithmStrategy::GetCachedGridTrackSize and GridTrack::CachedTrackSize don't return the GridTrackSize by reference. This means that some code like const GridLength& length = track.CachedTrackSize().MaxTrackBreadth(); DCHECK(length.IsFlex()); has a stack-use-after-scope issue, since GridTrackSize::MaxTrackBreadth returns a GridLength by reference, which will point to the temporary object returned by CachedTrackSize. To avoid this problem, this patch makes GetCachedGridTrackSize and CachedTrackSize return a const reference instead of a temporary copy. Change-Id: I3e43bf88a475b30747a101195705a22d93cc52a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919140Reviewed-by:Sergio Villar <svillar@igalia.com> Commit-Queue: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/master@{#715665}
Showing
Please register or sign in to comment