| Index: media/blink/url_index.cc
|
| diff --git a/media/blink/url_index.cc b/media/blink/url_index.cc
|
| index f255cb19f686e21499392dfa6e5d6528e74c83fa..21babb7f8e1e4e628b37db1a191926e94c12fd99 100644
|
| --- a/media/blink/url_index.cc
|
| +++ b/media/blink/url_index.cc
|
| @@ -149,10 +149,19 @@ void UrlData::OnEmpty() {
|
| scoped_refptr<UrlData>(this)));
|
| }
|
|
|
| -bool UrlData::Valid() const {
|
| +bool UrlData::FullyCached() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + if (length_ == kPositionNotSpecified)
|
| + return false;
|
| + // Check that the first unavailable block in the cache is after the
|
| + // end of the file.
|
| + return (multibuffer()->FindNextUnavailable(0) << kBlockSizeShift) >= length_;
|
| +}
|
| +
|
| +bool UrlData::Valid() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| base::Time now = base::Time::Now();
|
| - if (!range_supported_)
|
| + if (!range_supported_ && !FullyCached())
|
| return false;
|
| // When ranges are not supported, we cannot re-use cached data.
|
| if (valid_until_ > now)
|
|
|