Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: media/blink/buffered_data_source_host_impl.cc

Issue 574253002: Enhance WebMediaPlayer::buffered() to account for evicted ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/buffered_data_source_host_impl.h" 5 #include "media/blink/buffered_data_source_host_impl.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 BufferedDataSourceHostImpl::BufferedDataSourceHostImpl() 9 BufferedDataSourceHostImpl::BufferedDataSourceHostImpl()
10 : total_bytes_(0), 10 : total_bytes_(0),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 bool BufferedDataSourceHostImpl::DidLoadingProgress() { 52 bool BufferedDataSourceHostImpl::DidLoadingProgress() {
53 bool ret = did_loading_progress_; 53 bool ret = did_loading_progress_;
54 did_loading_progress_ = false; 54 did_loading_progress_ = false;
55 return ret; 55 return ret;
56 } 56 }
57 57
58 void BufferedDataSourceHostImpl::RemoveBufferedByteRange(int64 end) {
59 if (!buffered_byte_ranges_.size() || end <= buffered_byte_ranges_.start(0))
60 return;
61 Ranges<int64> removal_range;
62 removal_range.Add(
63 end, buffered_byte_ranges_.end(buffered_byte_ranges_.size() - 1));
64 buffered_byte_ranges_ = buffered_byte_ranges_.IntersectionWith(removal_range);
65 }
66
58 } // namespace media 67 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698