OLD | NEW |
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 Loading... |
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 |
OLD | NEW |