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

Side by Side Diff: chromecast/media/cma/base/balanced_media_task_runner_factory.cc

Issue 1127183008: Wake up other streams/task runners after removing ended stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698