| Index: media/base/media_log.h
|
| diff --git a/media/base/media_log.h b/media/base/media_log.h
|
| index 5394fff3963300a052d6726139ee3216a4f09fe0..1e4b9464dd761a6deecf1616eaeabcec3ed6d38b 100644
|
| --- a/media/base/media_log.h
|
| +++ b/media/base/media_log.h
|
| @@ -81,15 +81,9 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
|
| DISALLOW_COPY_AND_ASSIGN(MediaLog);
|
| };
|
|
|
| -// Indicates a string should be added to the log.
|
| -// First parameter - The log level for the string.
|
| -// Second parameter - The string to add to the log.
|
| -typedef base::Callback<void(MediaLog::MediaLogLevel, const std::string&)> LogCB;
|
| -
|
| -// Helper class to make it easier to use LogCB or MediaLog like DVLOG().
|
| +// Helper class to make it easier to use MediaLog like DVLOG().
|
| class MEDIA_EXPORT LogHelper {
|
| public:
|
| - LogHelper(MediaLog::MediaLogLevel level, const LogCB& log_cb);
|
| LogHelper(MediaLog::MediaLogLevel level,
|
| const scoped_refptr<MediaLog>& media_log);
|
| ~LogHelper();
|
| @@ -98,15 +92,14 @@ class MEDIA_EXPORT LogHelper {
|
|
|
| private:
|
| MediaLog::MediaLogLevel level_;
|
| - LogCB log_cb_;
|
| const scoped_refptr<MediaLog> media_log_;
|
| std::stringstream stream_;
|
| };
|
|
|
| // Provides a stringstream to collect a log entry to pass to the provided
|
| -// logger (LogCB or MediaLog) at the requested level.
|
| -#define MEDIA_LOG(level, logger) \
|
| - LogHelper((MediaLog::MEDIALOG_##level), (logger)).stream()
|
| +// MediaLog at the requested level.
|
| +#define MEDIA_LOG(level, media_log) \
|
| + LogHelper((MediaLog::MEDIALOG_##level), (media_log)).stream()
|
|
|
| // Logs only while |count| < |max|, increments |count| for each log, and warns
|
| // in the log if |count| has just reached |max|.
|
| @@ -121,8 +114,8 @@ class MEDIA_EXPORT LogHelper {
|
| // |count| < |max| and |count|++ is 0.
|
| // TODO(wolenetz,chcunningham): Consider using a helper class instead of a macro
|
| // to improve readability.
|
| -#define LIMITED_MEDIA_LOG(level, logger, count, max) \
|
| - LAZY_STREAM(MEDIA_LOG(level, logger), \
|
| +#define LIMITED_MEDIA_LOG(level, media_log, count, max) \
|
| + LAZY_STREAM(MEDIA_LOG(level, media_log), \
|
| (count) < (max) && ((count)++ || true)) \
|
| << (((count) == (max)) ? "(Log limit reached. Further similar entries " \
|
| "may be suppressed): " \
|
|
|