OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cma/base/balanced_media_task_runner_factory.h" | 5 #include "chromecast/media/cma/base/balanced_media_task_runner_factory.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 base::TimeDelta max_timestamp = min_timestamp + max_delta_; | 238 base::TimeDelta max_timestamp = min_timestamp + max_delta_; |
239 for (TaskRunnerMap::iterator it = runnable_task_runner.begin(); | 239 for (TaskRunnerMap::iterator it = runnable_task_runner.begin(); |
240 it != runnable_task_runner.end(); ++it) { | 240 it != runnable_task_runner.end(); ++it) { |
241 (*it).second->ScheduleWork(max_timestamp); | 241 (*it).second->ScheduleWork(max_timestamp); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 void BalancedMediaTaskRunnerFactory::UnregisterMediaTaskRunner( | 245 void BalancedMediaTaskRunnerFactory::UnregisterMediaTaskRunner( |
246 const scoped_refptr<BalancedMediaTaskRunner>& media_task_runner) { | 246 const scoped_refptr<BalancedMediaTaskRunner>& media_task_runner) { |
247 base::AutoLock auto_lock(lock_); | 247 base::AutoLock auto_lock(lock_); |
248 task_runners_.erase(media_task_runner); | 248 task_runners_.erase(media_task_runner); |
damienv1
2015/05/13 22:23:11
Note: the lock should not be applied on OnNewTask:
servolk
2015/05/13 22:25:45
Done.
| |
249 // After removing one of the task runners some of the other task runners might | |
250 // need to be waken up, if they are no longer blocked by the balancing | |
251 // restrictions with the old stream. | |
252 OnNewTask(); | |
249 } | 253 } |
250 | 254 |
251 } // namespace media | 255 } // namespace media |
252 } // namespace chromecast | 256 } // namespace chromecast |
OLD | NEW |