| 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/serial_runner.h" | 5 #include "media/base/serial_runner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 // Converts a Closure into a bound function accepting a PipelineStatusCB. | 15 // Converts a Closure into a bound function accepting a PipelineStatusCB. |
| 16 static void RunClosure( | 16 static void RunClosure( |
| 17 const base::Closure& closure, | 17 const base::Closure& closure, |
| 18 const PipelineStatusCB& status_cb) { | 18 const PipelineStatusCB& status_cb) { |
| 19 closure.Run(); | 19 closure.Run(); |
| 20 status_cb.Run(PIPELINE_OK); | 20 status_cb.Run(PIPELINE_OK); |
| 21 } | 21 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 BoundPipelineStatusCB bound_fn = bound_fns_.Pop(); | 108 BoundPipelineStatusCB bound_fn = bound_fns_.Pop(); |
| 109 bound_fn.Run(base::Bind( | 109 bound_fn.Run(base::Bind( |
| 110 &RunOnTaskRunner, | 110 &RunOnTaskRunner, |
| 111 task_runner_, | 111 task_runner_, |
| 112 base::Bind(&SerialRunner::RunNextInSeries, weak_factory_.GetWeakPtr()))); | 112 base::Bind(&SerialRunner::RunNextInSeries, weak_factory_.GetWeakPtr()))); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace media | 115 } // namespace media |
| OLD | NEW |