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

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

Issue 1971373002: Fix progress reporting for multibuffers to report progress for every byte we receive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 7 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_reader.cc ('k') | media/blink/resource_multibuffer_data_provider.h » ('j') | 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 writers.pop_back(); 58 writers.pop_back();
59 return; 59 return;
60 } 60 }
61 } 61 }
62 LOG(FATAL) << "Couldn't find myself in writers!"; 62 LOG(FATAL) << "Couldn't find myself in writers!";
63 } 63 }
64 64
65 MultiBufferBlockId Tell() const override { return pos_; } 65 MultiBufferBlockId Tell() const override { return pos_; }
66 66
67 bool Available() const override { return !fifo_.empty(); } 67 bool Available() const override { return !fifo_.empty(); }
68 int64_t AvailableBytes() const override { return 0; }
68 69
69 scoped_refptr<DataBuffer> Read() override { 70 scoped_refptr<DataBuffer> Read() override {
70 DCHECK(Available()); 71 DCHECK(Available());
71 scoped_refptr<DataBuffer> ret = fifo_.front(); 72 scoped_refptr<DataBuffer> ret = fifo_.front();
72 fifo_.pop_front(); 73 fifo_.pop_front();
73 ++pos_; 74 ++pos_;
74 return ret; 75 return ret;
75 } 76 }
76 77
77 void SetDeferred(bool deferred) override { 78 void SetDeferred(bool deferred) override {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 multibuffer_.CheckLRUState(); 567 multibuffer_.CheckLRUState();
567 } 568 }
568 multibuffer_.CheckPresentState(); 569 multibuffer_.CheckPresentState();
569 while (!read_helpers.empty()) { 570 while (!read_helpers.empty()) {
570 delete read_helpers.back(); 571 delete read_helpers.back();
571 read_helpers.pop_back(); 572 read_helpers.pop_back();
572 } 573 }
573 } 574 }
574 575
575 } // namespace media 576 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/multibuffer_reader.cc ('k') | media/blink/resource_multibuffer_data_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698