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

Unified Diff: content/renderer/media/render_media_log.h

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: content/renderer/media/render_media_log.h
diff --git a/content/renderer/media/render_media_log.h b/content/renderer/media/render_media_log.h
index ed9ce629889c0b1d2c5eb53eb77f4db4d4fdcf8a..00d66cb889244ee17b6940699b1f45745485a81a 100644
--- a/content/renderer/media/render_media_log.h
+++ b/content/renderer/media/render_media_log.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_RENDERER_MEDIA_RENDER_MEDIA_LOG_H_
#define CONTENT_RENDERER_MEDIA_RENDER_MEDIA_LOG_H_
+#include <deque>
#include <string>
#include <vector>
@@ -37,7 +38,7 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
// MediaLog implementation.
void AddEvent(std::unique_ptr<media::MediaLogEvent> event) override;
- std::string GetLastErrorMessage() override;
+ std::map<std::string, std::vector<std::string>> GetErrorMessages() override;
void RecordRapporWithSecurityOrigin(const std::string& metric) override;
// Will reset |last_ipc_send_time_| with the value of NowTicks().
@@ -60,7 +61,7 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
// |lock_| protects access to all of the following member variables. It
// allows any render process thread to AddEvent(), while preserving their
// sequence for throttled send on |task_runner_| and coherent retrieval by
- // GetLastErrorMessage().
+ // GetErrorMessages().
mutable base::Lock lock_;
std::unique_ptr<base::TickClock> tick_clock_;
base::TimeTicks last_ipc_send_time_;
@@ -73,8 +74,10 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
std::unique_ptr<media::MediaLogEvent> last_buffered_extents_changed_event_;
std::unique_ptr<media::MediaLogEvent> last_duration_changed_event_;
- // Holds a copy of the most recent MEDIA_ERROR_LOG_ENTRY, if any.
- std::unique_ptr<media::MediaLogEvent> last_media_error_log_entry_;
+ // Holds copies of the most recent MEDIA_ERROR_LOG_ENTRY, if any, up to a
+ // capped amount.
+ std::deque<std::unique_ptr<media::MediaLogEvent>>
sandersd (OOO until July 31) 2017/04/12 01:09:38 Perhaps std::vector would be a better choice, sinc
wolenetz 2017/04/13 23:59:10 And std::unique_ptrs to them are even smaller ;)
+ recent_media_error_log_entries_;
// Holds a copy of the most recent PIPELINE_ERROR, if any.
std::unique_ptr<media::MediaLogEvent> last_pipeline_error_;

Powered by Google App Engine
This is Rietveld 408576698