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

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

Issue 2115483003: Revert of Fix MultibufferDataSource::GetSize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « media/blink/multibuffer_data_source_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/multibuffer_data_source_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698