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

Unified Diff: media/base/media_log.cc

Issue 10332082: Remove reporting statistics reporting from chrome://media-internals and fix event logging. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_log.cc
diff --git a/media/base/media_log.cc b/media/base/media_log.cc
index 3be43662afc7b696afd90b767bae6beac02a50d8..6d215b228ed291bc83ada5bc78b1fdfdaded8078 100644
--- a/media/base/media_log.cc
+++ b/media/base/media_log.cc
@@ -7,18 +7,14 @@
#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"
-#include "base/message_loop.h"
#include "base/values.h"
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 +52,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 +133,11 @@ 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()) {}
MediaLog::~MediaLog() {}
-void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {
-}
+void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {}
scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) {
scoped_ptr<MediaLogEvent> event(new MediaLogEvent);
@@ -223,36 +213,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
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698