summaryrefslogtreecommitdiffstats
path: root/media/base/media_log.h
diff options
context:
space:
mode:
authorscottfr@chromium.org <scottfr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 23:26:40 +0000
committerscottfr@chromium.org <scottfr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 23:26:40 +0000
commit090f7313473bb61b6b294f1bfbb3b05f9140dec3 (patch)
tree1b576c7618ac4f85a45ab7aa1237a3aff8597276 /media/base/media_log.h
parentd91b48f15b5e550f5e0ff3550d51ef8aeebdd2b1 (diff)
downloadchromium_src-090f7313473bb61b6b294f1bfbb3b05f9140dec3.zip
chromium_src-090f7313473bb61b6b294f1bfbb3b05f9140dec3.tar.gz
chromium_src-090f7313473bb61b6b294f1bfbb3b05f9140dec3.tar.bz2
Plumb media data from renderers up to MediaInternals in the browser process.
Relanding 95542. Reverted due to issue caused by 95496. BUG=none TEST=manually Review URL: http://codereview.chromium.org/7480032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/media_log.h')
-rw-r--r--media/base/media_log.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/media/base/media_log.h b/media/base/media_log.h
new file mode 100644
index 0000000..fcf0c31
--- /dev/null
+++ b/media/base/media_log.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_MEDIA_LOG_H_
+#define MEDIA_BASE_MEDIA_LOG_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "media/base/media_log_event.h"
+
+namespace media {
+
+class MediaLog : public base::RefCountedThreadSafe<MediaLog> {
+ public:
+
+ // Return a string to represent an EventType.
+ static const char* EventTypeToString(MediaLogEvent::Type type);
+
+ MediaLog();
+
+ // Methods called by loggers when events occur. These generate appropriate
+ // event parameters so the caller need not worry about them.
+ void Load(const std::string& url);
+
+ // Add an event to this log. Overriden by inheritors to actually do something
+ // with it.
+ // Takes ownership of |event|.
+ virtual void AddEvent(MediaLogEvent* event);
+
+ // Convenience method for adding an event with no parameters.
+ void AddEventOfType(MediaLogEvent::Type type);
+
+ // Convenience method for filling in common fields of a new event.
+ MediaLogEvent* CreateEvent(MediaLogEvent::Type type);
+
+ protected:
+ friend class base::RefCountedThreadSafe<MediaLog>;
+ virtual ~MediaLog();
+
+ private:
+ // A unique (to this process) id for this MediaLog.
+ int32 id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaLog);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_MEDIA_LOG_H_