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

Unified Diff: media/base/media_log.cc

Issue 2660003003: Add MediaError.message (Closed)
Patch Set: --flakiness by using std::map, update virtual/stable/[win,mac] global interface listing too 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.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, &params_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) {

Powered by Google App Engine
This is Rietveld 408576698