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

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

Issue 1846913004: MediaLog: Replace task posting in AddEvent with lock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initializes |ipc_send_pending_|. Comment clean-ups. Created 4 years, 9 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 a67927d1228d3574449a9035750a164089ded399..23ff1679dca6e43b01b82a0ed02fa5c1fe4c1498 100644
--- a/content/renderer/media/render_media_log.h
+++ b/content/renderer/media/render_media_log.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "media/base/media_log.h"
@@ -40,17 +41,19 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
private:
~RenderMediaLog() override;
- // Add event on the |task_runner_|.
- void AddEventInternal(scoped_ptr<media::MediaLogEvent> event);
-
- // Posted as a delayed task to throttle ipc message frequency.
+ // Posted as a delayed task on |task_runner_| to throttle ipc message
+ // frequency.
void SendQueuedMediaEvents();
+ mutable base::Lock lock_;
xhwang 2016/04/01 05:42:55 Could you please be more specific about what this
wolenetz 2016/04/04 18:30:32 Done.
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
scoped_ptr<base::TickClock> tick_clock_;
base::TimeTicks last_ipc_send_time_;
std::vector<media::MediaLogEvent> queued_media_events_;
+ // For enforcing max 1 pending send.
+ bool ipc_send_pending_;
+
// Limits the number buffered extents changed events we send over IPC to one.
scoped_ptr<media::MediaLogEvent> last_buffered_extents_changed_event_;
« no previous file with comments | « no previous file | content/renderer/media/render_media_log.cc » ('j') | content/renderer/media/render_media_log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698