diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-23 15:44:34 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-23 15:44:34 +0000 |
commit | ba92fa90c4d2b3a7a754a45d03b6022f58ed2b17 (patch) | |
tree | 1608a632311d9e9bb71f2bae7ea66a90ba207ade /media | |
parent | 2665642c2d683913518dacd7c64d5f9475138969 (diff) | |
download | chromium_src-ba92fa90c4d2b3a7a754a45d03b6022f58ed2b17.zip chromium_src-ba92fa90c4d2b3a7a754a45d03b6022f58ed2b17.tar.gz chromium_src-ba92fa90c4d2b3a7a754a45d03b6022f58ed2b17.tar.bz2 |
Don't try to post tasks to a NULL MessageLoop from MediaLog.
(this situation can arise b/c VideoRendererBase uses a
base::PlatformThread::Delegate instead of a more-legit base::Thread)
BUG=93821
TEST=trybots
Review URL: http://codereview.chromium.org/7709015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/media_log.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/base/media_log.cc b/media/base/media_log.cc index 9ead460..62f509e 100644 --- a/media/base/media_log.cc +++ b/media/base/media_log.cc @@ -232,7 +232,10 @@ void MediaLog::QueueStatisticsUpdatedEvent(PipelineStatistics stats) { base::AutoLock auto_lock(stats_lock_); last_statistics_ = stats; - if (!stats_update_pending_) { + // Sadly, this function can get dispatched on threads not running a message + // loop. Happily, this is pretty rare (only VideoRendererBase at this time) + // so we simply leave stats updating for another call to trigger. + if (!stats_update_pending_ && MessageLoop::current()) { stats_update_pending_ = true; MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod(this, &media::MediaLog::AddStatisticsUpdatedEvent), |