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

Unified Diff: media/blink/video_frame_compositor.cc

Issue 2159323002: Add tracing AutoOpenCloseEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review changes Created 4 years, 4 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/blink/video_frame_compositor.cc
diff --git a/media/blink/video_frame_compositor.cc b/media/blink/video_frame_compositor.cc
index 544f7098701d481c2358c2493d2f59aae52d5256..b8d055ef227243cc4ea1f13ad7bcc9cb2afc62f9 100644
--- a/media/blink/video_frame_compositor.cc
+++ b/media/blink/video_frame_compositor.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/time/default_tick_clock.h"
#include "base/trace_event/trace_event.h"
+#include "base/trace_event/video_playback_pae.h"
#include "media/base/video_frame.h"
namespace media {
@@ -35,7 +36,9 @@ VideoFrameCompositor::VideoFrameCompositor(
new_background_frame_(false),
// Assume 60Hz before the first UpdateCurrentFrame() call.
last_interval_(base::TimeDelta::FromSecondsD(1.0 / 60)),
- callback_(nullptr) {
+ callback_(nullptr),
+ persistent_async_(
+ new base::trace_event::VideoPlaybackPersistentAsyncEvent()) {
background_rendering_timer_.SetTaskRunner(compositor_task_runner_);
}
@@ -105,8 +108,7 @@ bool VideoFrameCompositor::HasCurrentFrame() {
}
void VideoFrameCompositor::Start(RenderCallback* callback) {
- TRACE_EVENT_ASYNC_BEGIN0("media,rail", "VideoPlayback",
DaleCurtis 2016/08/30 19:09:49 Do we really need a Start()/Stop() API or should t
alexandermont 2016/08/30 19:34:36 I don't really see an advantage of doing it the wa
DaleCurtis 2016/08/30 19:42:31 Generally I find it preferable to avoid unnecessar
alexandermont 2016/08/31 18:31:59 See discussion below in comments. Given that futur
- static_cast<const void*>(this));
+ persistent_async_->Start();
// Called from the media thread, so acquire the callback under lock before
// returning in case a Stop() call comes in before the PostTask is processed.
@@ -119,8 +121,7 @@ void VideoFrameCompositor::Start(RenderCallback* callback) {
}
void VideoFrameCompositor::Stop() {
- TRACE_EVENT_ASYNC_END0("media,rail", "VideoPlayback",
- static_cast<const void*>(this));
+ persistent_async_->Stop();
// Called from the media thread, so release the callback under lock before
// returning to avoid a pending UpdateCurrentFrame() call occurring before
« media/blink/video_frame_compositor.h ('K') | « media/blink/video_frame_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698