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

Side by Side Diff: media/base/mock_filters.cc

Issue 8936014: Removing DataSource from Filter hierarchy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build busters Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/mock_filters.h" 5 #include "media/base/mock_filters.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/filter_host.h" 8 #include "media/base/filter_host.h"
9 9
10 using ::testing::_; 10 using ::testing::_;
11 using ::testing::Invoke; 11 using ::testing::Invoke;
12 using ::testing::NotNull; 12 using ::testing::NotNull;
13 13
14 namespace media { 14 namespace media {
15 15
16 MockDataSource::MockDataSource() 16 MockDataSource::MockDataSource()
17 : total_bytes_(-1), 17 : total_bytes_(-1),
18 buffered_bytes_(-1) { 18 buffered_bytes_(-1) {
19 } 19 }
20 20
21 MockDataSource::~MockDataSource() {} 21 MockDataSource::~MockDataSource() {}
22 22
23 void MockDataSource::set_host(FilterHost* filter_host) { 23 void MockDataSource::set_host(DataSourceHost* data_source_host) {
24 Filter::set_host(filter_host); 24 DataSource::set_host(data_source_host);
25 25
26 if (total_bytes_ > 0) 26 if (total_bytes_ > 0)
27 host()->SetTotalBytes(total_bytes_); 27 host()->SetTotalBytes(total_bytes_);
28 28
29 if (buffered_bytes_ > 0) 29 if (buffered_bytes_ > 0)
30 host()->SetBufferedBytes(buffered_bytes_); 30 host()->SetBufferedBytes(buffered_bytes_);
31 } 31 }
32 32
33 void MockDataSource::SetTotalAndBufferedBytes(int64 total_bytes, 33 void MockDataSource::SetTotalAndBufferedBytes(int64 total_bytes,
34 int64 buffered_bytes) { 34 int64 buffered_bytes) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 DemuxerFactory* MockDemuxerFactory::Clone() const { 68 DemuxerFactory* MockDemuxerFactory::Clone() const {
69 return new MockDemuxerFactory(demuxer_.get()); 69 return new MockDemuxerFactory(demuxer_.get());
70 } 70 }
71 71
72 MockDemuxer::MockDemuxer() 72 MockDemuxer::MockDemuxer()
73 : total_bytes_(-1), buffered_bytes_(-1), duration_() {} 73 : total_bytes_(-1), buffered_bytes_(-1), duration_() {}
74 74
75 MockDemuxer::~MockDemuxer() {} 75 MockDemuxer::~MockDemuxer() {}
76 76
77 void MockDemuxer::set_host(FilterHost* filter_host) { 77 void MockDemuxer::set_host(DemuxerHost* demuxer_host) {
78 Demuxer::set_host(filter_host); 78 Demuxer::set_host(demuxer_host);
79 79
80 if (total_bytes_ > 0) 80 if (total_bytes_ > 0)
81 host()->SetTotalBytes(total_bytes_); 81 host()->SetTotalBytes(total_bytes_);
82 82
83 if (buffered_bytes_ > 0) 83 if (buffered_bytes_ > 0)
84 host()->SetBufferedBytes(buffered_bytes_); 84 host()->SetBufferedBytes(buffered_bytes_);
85 85
86 if (duration_.InMilliseconds() > 0) 86 if (duration_.InMilliseconds() > 0)
87 host()->SetDuration(duration_); 87 host()->SetDuration(duration_);
88 } 88 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 MockFilter::MockFilter() { 179 MockFilter::MockFilter() {
180 } 180 }
181 181
182 MockFilter::~MockFilter() {} 182 MockFilter::~MockFilter() {}
183 183
184 MockStatisticsCallback::MockStatisticsCallback() {} 184 MockStatisticsCallback::MockStatisticsCallback() {}
185 185
186 MockStatisticsCallback::~MockStatisticsCallback() {} 186 MockStatisticsCallback::~MockStatisticsCallback() {}
187 187
188 } // namespace media 188 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698