| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/pipeline_impl.h" | 5 #include "media/base/pipeline_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 if (!seek_cb_.is_null()) { | 1249 if (!seek_cb_.is_null()) { |
| 1250 base::ResetAndReturn(&seek_cb_).Run(error); | 1250 base::ResetAndReturn(&seek_cb_).Run(error); |
| 1251 } else if (!suspend_cb_.is_null()) { | 1251 } else if (!suspend_cb_.is_null()) { |
| 1252 base::ResetAndReturn(&suspend_cb_).Run(error); | 1252 base::ResetAndReturn(&suspend_cb_).Run(error); |
| 1253 } else { | 1253 } else { |
| 1254 DCHECK(client_); | 1254 DCHECK(client_); |
| 1255 client_->OnError(error); | 1255 client_->OnError(error); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 // Any kind of error stops the pipeline. | 1258 // Any kind of error stops the pipeline. |
| 1259 // |
| 1260 // TODO (tguilbert): Move this out to PipelineController to make the state |
| 1261 // changes more consistent. See crbug.com/695734. |
| 1259 Stop(); | 1262 Stop(); |
| 1260 } | 1263 } |
| 1261 | 1264 |
| 1262 void PipelineImpl::OnEnded() { | 1265 void PipelineImpl::OnEnded() { |
| 1263 DVLOG(2) << __func__; | 1266 DVLOG(2) << __func__; |
| 1264 DCHECK(thread_checker_.CalledOnValidThread()); | 1267 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1265 DCHECK(IsRunning()); | 1268 DCHECK(IsRunning()); |
| 1266 | 1269 |
| 1267 DCHECK(client_); | 1270 DCHECK(client_); |
| 1268 client_->OnEnded(); | 1271 client_->OnEnded(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 void PipelineImpl::OnSuspendDone() { | 1360 void PipelineImpl::OnSuspendDone() { |
| 1358 DVLOG(3) << __func__; | 1361 DVLOG(3) << __func__; |
| 1359 DCHECK(thread_checker_.CalledOnValidThread()); | 1362 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1360 DCHECK(IsRunning()); | 1363 DCHECK(IsRunning()); |
| 1361 | 1364 |
| 1362 DCHECK(!suspend_cb_.is_null()); | 1365 DCHECK(!suspend_cb_.is_null()); |
| 1363 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); | 1366 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); |
| 1364 } | 1367 } |
| 1365 | 1368 |
| 1366 } // namespace media | 1369 } // namespace media |
| OLD | NEW |