| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/resource_multibuffer_data_provider.h" | 5 #include "media/blink/resource_multibuffer_data_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 int64_t total_encoded_data_length) { | 395 int64_t total_encoded_data_length) { |
| 396 DVLOG(1) << "didFinishLoading"; | 396 DVLOG(1) << "didFinishLoading"; |
| 397 DCHECK(active_loader_.get()); | 397 DCHECK(active_loader_.get()); |
| 398 DCHECK(!Available()); | 398 DCHECK(!Available()); |
| 399 | 399 |
| 400 // We're done with the loader. | 400 // We're done with the loader. |
| 401 active_loader_.reset(); | 401 active_loader_.reset(); |
| 402 | 402 |
| 403 // If we didn't know the |instance_size_| we do now. | 403 // If we didn't know the |instance_size_| we do now. |
| 404 int64_t size = byte_pos(); | 404 int64_t size = byte_pos(); |
| 405 if (!fifo_.empty()) |
| 406 size += fifo_.back()->data_size(); |
| 405 | 407 |
| 406 // This request reports something smaller than what we've seen in the past, | 408 // This request reports something smaller than what we've seen in the past, |
| 407 // Maybe it's transient error? | 409 // Maybe it's transient error? |
| 408 if (url_data_->length() != kPositionNotSpecified && | 410 if (url_data_->length() != kPositionNotSpecified && |
| 409 size < url_data_->length()) { | 411 size < url_data_->length()) { |
| 410 if (retries_ < kMaxRetries) { | 412 if (retries_ < kMaxRetries) { |
| 411 DVLOG(1) << " Partial data received.... @ pos = " << size; | 413 DVLOG(1) << " Partial data received.... @ pos = " << size; |
| 412 retries_++; | 414 retries_++; |
| 413 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 415 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 414 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Start, | 416 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Start, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 } | 528 } |
| 527 | 529 |
| 528 if (byte_pos() != first_byte_position) { | 530 if (byte_pos() != first_byte_position) { |
| 529 return false; | 531 return false; |
| 530 } | 532 } |
| 531 | 533 |
| 532 return true; | 534 return true; |
| 533 } | 535 } |
| 534 | 536 |
| 535 } // namespace media | 537 } // namespace media |
| OLD | NEW |