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

Unified Diff: media/base/media_log.h

Issue 7480032: Plumb media data from renderers up to MediaInternals in the browser process. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responding to feedback. Created 9 years, 5 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
Index: media/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
new file mode 100644
index 0000000000000000000000000000000000000000..734a83f2fa70e681e175130497dcee4350fa2995
--- /dev/null
+++ b/media/base/media_log.h
@@ -0,0 +1,52 @@
+// 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 "base/time.h"
+#include "base/values.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_

Powered by Google App Engine
This is Rietveld 408576698