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

Unified Diff: media/base/media_log.h

Issue 2837133002: To M59: Add MediaError.message (Closed)
Patch Set: 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
Index: media/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
index cb0a6b622aabebf1853f7c26e5cf42f9352808fd..621f721149e9c2af4d98ba4070e10baeabf12eea 100644
--- a/media/base/media_log.h
+++ b/media/base/media_log.h
@@ -37,19 +37,33 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
static std::string MediaLogLevelToString(MediaLogLevel level);
static MediaLogEvent::Type MediaLogLevelToEventType(MediaLogLevel level);
static std::string EventTypeToString(MediaLogEvent::Type type);
+
+ // Returns a string version of the status, unique to each PipelineStatus, and
+ // not including any ':'. This makes it suitable for usage in
+ // MediaError.message as the UA-specific-error-code.
static std::string PipelineStatusToString(PipelineStatus status);
+
static std::string BufferingStateToString(BufferingState state);
static std::string MediaEventToLogString(const MediaLogEvent& event);
+ // Returns a string usable as part of a MediaError.message, for only
+ // PIPELINE_ERROR or MEDIA_ERROR_LOG_ENTRY events, with any newlines replaced
+ // with whitespace in the latter kind of events.
+ static std::string MediaEventToMessageString(const MediaLogEvent& event);
+
MediaLog();
// Add an event to this log. Overriden by inheritors to actually do something
// with it.
virtual void AddEvent(std::unique_ptr<MediaLogEvent> event);
- // Retrieve an error message, if any.
- virtual std::string GetLastErrorMessage();
+ // Returns a string usable as the contents of a MediaError.message.
+ // This method returns an incomplete message if it is called before the
+ // pertinent events for the error have been added to the log.
+ // Note: The base class definition only produces empty messages. See
+ // RenderMediaLog for where this method is meaningful.
+ virtual std::string GetErrorMessage();
// Records the domain and registry of the current frame security origin to a
// Rappor privacy-preserving metric. See:
« no previous file with comments | « content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698