Chromium Code Reviews| Index: media/base/media_log.cc |
| diff --git a/media/base/media_log.cc b/media/base/media_log.cc |
| index e354ea03e8c05115636a2a9d0d2e9c759ee63ac9..fccdcb3c67cc17cef0d076155b7de59a9f204da9 100644 |
| --- a/media/base/media_log.cc |
| +++ b/media/base/media_log.cc |
| @@ -208,7 +208,8 @@ std::string MediaLog::PipelineStatusToString(PipelineStatus status) { |
| return NULL; |
| } |
| -std::string MediaLog::MediaEventToLogString(const MediaLogEvent& event) { |
| +std::string MediaLog::MediaEventToLogString(const MediaLogEvent& event, |
| + bool include_type) { |
|
sandersd (OOO until July 31)
2017/04/12 01:09:38
Not a fan of this parameter, it's not clear from c
wolenetz
2017/04/13 23:59:10
Done.
|
| // Special case for PIPELINE_ERROR, since that's by far the most useful |
| // event for figuring out media pipeline failures, and just reporting |
| // pipeline status as numeric code is not very helpful/user-friendly. |
| @@ -216,11 +217,18 @@ std::string MediaLog::MediaEventToLogString(const MediaLogEvent& event) { |
| if (event.type == MediaLogEvent::PIPELINE_ERROR && |
| event.params.GetInteger("pipeline_error", &error_code)) { |
| PipelineStatus status = static_cast<PipelineStatus>(error_code); |
| - return EventTypeToString(event.type) + " " + PipelineStatusToString(status); |
| + if (include_type) { |
| + return EventTypeToString(event.type) + " " + |
| + PipelineStatusToString(status); |
| + } |
| + return PipelineStatusToString(status); |
| } |
| + |
| std::string params_json; |
| base::JSONWriter::Write(event.params, ¶ms_json); |
| - return EventTypeToString(event.type) + " " + params_json; |
| + if (include_type) |
| + return EventTypeToString(event.type) + " " + params_json; |
| + return params_json; |
| } |
| std::string MediaLog::BufferingStateToString(BufferingState state) { |
| @@ -240,8 +248,8 @@ MediaLog::~MediaLog() {} |
| void MediaLog::AddEvent(std::unique_ptr<MediaLogEvent> event) {} |
| -std::string MediaLog::GetLastErrorMessage() { |
| - return ""; |
| +std::map<std::string, std::vector<std::string>> MediaLog::GetErrorMessages() { |
| + return std::map<std::string, std::vector<std::string>>(); |
| } |
| void MediaLog::RecordRapporWithSecurityOrigin(const std::string& metric) { |