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

Unified Diff: media/base/media_log.h

Issue 1235793005: Deprecate LogCB in favor of using MediaLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and attempt to fix Android compilation Created 5 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
« no previous file with comments | « content/renderer/media/android/media_source_delegate.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 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): " \
« no previous file with comments | « content/renderer/media/android/media_source_delegate.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698