Chromium Code Reviews| Index: media/base/media_log.cc |
| diff --git a/media/base/media_log.cc b/media/base/media_log.cc |
| index 3be43662afc7b696afd90b767bae6beac02a50d8..1dda4956ed4b823d4c2bca80e206f91c8d8c66e9 100644 |
| --- a/media/base/media_log.cc |
| +++ b/media/base/media_log.cc |
| @@ -7,8 +7,6 @@ |
| #include <string> |
| #include "base/atomic_sequence_num.h" |
| -#include "base/bind.h" |
| -#include "base/lazy_instance.h" |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
|
scherkus (not reviewing)
2012/05/10 02:45:03
this .h should be removed
|
| #include "base/message_loop.h" |
| @@ -16,9 +14,9 @@ |
| namespace media { |
| -// A count of all MediaLogs created on this render process. |
| -// Used to generate unique ids. |
| -static base::StaticAtomicSequenceNumber media_log_count; |
| +// A count of all MediaLogs created in the current process. Used to generate |
| +// unique IDs. |
| +static base::StaticAtomicSequenceNumber g_media_log_count; |
| const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { |
| switch (type) { |
| @@ -56,8 +54,6 @@ const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { |
| return "AUDIO_RENDERER_DISABLED"; |
| case MediaLogEvent::BUFFERED_EXTENTS_CHANGED: |
| return "BUFFERED_EXTENTS_CHANGED"; |
| - case MediaLogEvent::STATISTICS_UPDATED: |
| - return "STATISTICS_UPDATED"; |
| } |
| NOTREACHED(); |
| return NULL; |
| @@ -139,15 +135,13 @@ const char* MediaLog::PipelineStatusToString(PipelineStatus status) { |
| return NULL; |
| } |
| -MediaLog::MediaLog() { |
| - id_ = media_log_count.GetNext(); |
| - stats_update_pending_ = false; |
| +MediaLog::MediaLog() |
| + : id_(g_media_log_count.GetNext()) { |
|
scherkus (not reviewing)
2012/05/10 02:45:03
crap I need to fix indent here
Ami GONE FROM CHROMIUM
2012/05/10 17:16:49
single line?
scherkus (not reviewing)
2012/05/10 17:31:23
Done.
|
| } |
| MediaLog::~MediaLog() {} |
| -void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) { |
| -} |
| +void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {} |
|
Ami GONE FROM CHROMIUM
2012/05/10 17:16:49
Should this be pure-virtual?
scherkus (not reviewing)
2012/05/10 17:31:23
We create non-overridden MediaLogs in a few spots
|
| scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) { |
| scoped_ptr<MediaLogEvent> event(new MediaLogEvent); |
| @@ -223,36 +217,4 @@ scoped_ptr<MediaLogEvent> MediaLog::CreateBufferedExtentsChangedEvent( |
| return event.Pass(); |
| } |
| -void MediaLog::QueueStatisticsUpdatedEvent(PipelineStatistics stats) { |
| - base::AutoLock auto_lock(stats_lock_); |
| - last_statistics_ = stats; |
| - |
| - // 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, |
| - base::Bind(&media::MediaLog::AddStatisticsUpdatedEvent, this), |
| - base::TimeDelta::FromMilliseconds(500)); |
| - } |
| -} |
| - |
| -void MediaLog::AddStatisticsUpdatedEvent() { |
| - base::AutoLock auto_lock(stats_lock_); |
| - scoped_ptr<MediaLogEvent> event( |
| - CreateEvent(MediaLogEvent::STATISTICS_UPDATED)); |
| - event->params.SetInteger("audio_bytes_decoded", |
| - last_statistics_.audio_bytes_decoded); |
| - event->params.SetInteger("video_bytes_decoded", |
| - last_statistics_.video_bytes_decoded); |
| - event->params.SetInteger("video_frames_decoded", |
| - last_statistics_.video_frames_decoded); |
| - event->params.SetInteger("video_frames_dropped", |
| - last_statistics_.video_frames_dropped); |
| - AddEvent(event.Pass()); |
| - stats_update_pending_ = false; |
| -} |
| - |
| } //namespace media |