| Index: media/blink/multibuffer.cc
|
| diff --git a/media/blink/multibuffer.cc b/media/blink/multibuffer.cc
|
| index c17d80c81aa6eef5565d7ed04b201792935c7407..a59ac5e854232277ecbaf4c153ed0413fd0159d9 100644
|
| --- a/media/blink/multibuffer.cc
|
| +++ b/media/blink/multibuffer.cc
|
| @@ -460,8 +460,6 @@ void MultiBuffer::PinRange(const BlockId& from,
|
| // Iterate over all the modified ranges and check if any of them have
|
| // transitioned in or out of the unlocked state. If so, we iterate over
|
| // all buffers in that range and add/remove them from the LRU as approperiate.
|
| - // We iterate *backwards* through the ranges, with the idea that data in a
|
| - // continous range should be freed from the end first.
|
|
|
| if (data_.empty())
|
| return;
|
| @@ -479,16 +477,16 @@ void MultiBuffer::PinRange(const BlockId& from,
|
| // For each range that has transitioned to/from a pinned state,
|
| // we iterate over the corresponding ranges in |present_| to find
|
| // the blocks that are actually in the multibuffer.
|
| - for (auto present_block_range = present_.find(transition_range.end - 1);
|
| - present_block_range != present_.begin(); --present_block_range) {
|
| + for (auto present_block_range = present_.find(transition_range.begin);
|
| + present_block_range != present_.end(); ++present_block_range) {
|
| if (!present_block_range.value())
|
| continue;
|
| Interval<BlockId> present_transitioned_range =
|
| transition_range.Intersect(present_block_range.interval());
|
| if (present_transitioned_range.Empty())
|
| break;
|
| - for (BlockId block = present_transitioned_range.end - 1;
|
| - block >= present_transitioned_range.begin; --block) {
|
| + for (BlockId block = present_transitioned_range.begin;
|
| + block < present_transitioned_range.end; ++block) {
|
| DCHECK_GE(block, 0);
|
| DCHECK(data_.find(block) != data_.end());
|
| if (pin) {
|
|
|