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

Unified Diff: media/base/media_log.h

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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/demuxer_perftest.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
index cb0a6b622aabebf1853f7c26e5cf42f9352808fd..0ab19efb9cef007d126d6cabaac257d9a0fc996e 100644
--- a/media/base/media_log.h
+++ b/media/base/media_log.h
@@ -15,7 +15,6 @@
#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
#include "media/base/buffering_state.h"
#include "media/base/media_export.h"
#include "media/base/media_log_event.h"
@@ -25,7 +24,7 @@
namespace media {
-class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
+class MEDIA_EXPORT MediaLog {
public:
enum MediaLogLevel {
MEDIALOG_ERROR,
@@ -43,6 +42,7 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
static std::string MediaEventToLogString(const MediaLogEvent& event);
MediaLog();
+ virtual ~MediaLog();
// Add an event to this log. Overriden by inheritors to actually do something
// with it.
@@ -123,10 +123,6 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
static base::flat_set<base::StringPiece> GetWatchTimeKeys();
static base::flat_set<base::StringPiece> GetWatchTimePowerKeys();
- protected:
- friend class base::RefCountedThreadSafe<MediaLog>;
- virtual ~MediaLog();
-
private:
// A unique (to this process) id for this MediaLog.
int32_t id_;
@@ -137,15 +133,14 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
// Helper class to make it easier to use MediaLog like DVLOG().
class MEDIA_EXPORT LogHelper {
public:
- LogHelper(MediaLog::MediaLogLevel level,
- const scoped_refptr<MediaLog>& media_log);
+ LogHelper(MediaLog::MediaLogLevel level, MediaLog* media_log);
~LogHelper();
std::ostream& stream() { return stream_; }
private:
- MediaLog::MediaLogLevel level_;
- const scoped_refptr<MediaLog> media_log_;
+ const MediaLog::MediaLogLevel level_;
+ MediaLog* const media_log_;
std::stringstream stream_;
};
« no previous file with comments | « media/base/demuxer_perftest.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698