| OLD | NEW |
| 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/composite_filter.h" | 5 #include "media/base/composite_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 LOG(FATAL) << "Unknown filter, or in unexpected state."; | 75 LOG(FATAL) << "Unknown filter, or in unexpected state."; |
| 76 | 76 |
| 77 for (FilterVector::iterator it = filters_.begin(); | 77 for (FilterVector::iterator it = filters_.begin(); |
| 78 it != filters_.end(); ++it) { | 78 it != filters_.end(); ++it) { |
| 79 if (it->get() != filter.get()) | 79 if (it->get() != filter.get()) |
| 80 continue; | 80 continue; |
| 81 filters_.erase(it); | 81 filters_.erase(it); |
| 82 filter->clear_host(); | 82 filter->clear_host(); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 NOTREACHED() << "Filter missing."; | 85 LOG(FATAL) << "Filter missing."; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CompositeFilter::set_host(FilterHost* host) { | 88 void CompositeFilter::set_host(FilterHost* host) { |
| 89 DCHECK_EQ(message_loop_, MessageLoop::current()); | 89 DCHECK_EQ(message_loop_, MessageLoop::current()); |
| 90 DCHECK(host); | 90 DCHECK(host); |
| 91 DCHECK(!host_impl_.get()); | 91 DCHECK(!host_impl_.get()); |
| 92 host_impl_.reset(new FilterHostImpl(this, host)); | 92 host_impl_.reset(new FilterHostImpl(this, host)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 FilterHost* CompositeFilter::host() { | 95 FilterHost* CompositeFilter::host() { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 void CompositeFilter::FilterHostImpl::SetCurrentReadPosition(int64 offset) { | 545 void CompositeFilter::FilterHostImpl::SetCurrentReadPosition(int64 offset) { |
| 546 host_->SetCurrentReadPosition(offset); | 546 host_->SetCurrentReadPosition(offset); |
| 547 } | 547 } |
| 548 | 548 |
| 549 int64 CompositeFilter::FilterHostImpl::GetCurrentReadPosition() { | 549 int64 CompositeFilter::FilterHostImpl::GetCurrentReadPosition() { |
| 550 return host_->GetCurrentReadPosition(); | 550 return host_->GetCurrentReadPosition(); |
| 551 } | 551 } |
| 552 | 552 |
| 553 } // namespace media | 553 } // namespace media |
| OLD | NEW |