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

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: update design Created 4 years, 3 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..38b8e2f80ae63650132059f614d3cbea38d9f850 100644
--- a/media/blink/video_frame_compositor.cc
+++ b/media/blink/video_frame_compositor.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/time/default_tick_clock.h"
+#include "base/trace_event/persistent_async_event.h"
#include "base/trace_event/trace_event.h"
#include "media/base/video_frame.h"
@@ -35,7 +36,11 @@ 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::PersistentAsyncEvent(
+ base::trace_event::PersistentAsyncEvent::Type::ASYNC,
Primiano Tucci (use gerrit) 2016/09/15 10:08:30 Type is an enum, not a C++11 enum class. I'm fine
+ "media,rail",
+ "VideoPlayback")) {
background_rendering_timer_.SetTaskRunner(compositor_task_runner_);
}
@@ -105,8 +110,7 @@ bool VideoFrameCompositor::HasCurrentFrame() {
}
void VideoFrameCompositor::Start(RenderCallback* callback) {
- TRACE_EVENT_ASYNC_BEGIN0("media,rail", "VideoPlayback",
- static_cast<const void*>(this));
+ persistent_async_->Begin();
// 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 +123,7 @@ void VideoFrameCompositor::Start(RenderCallback* callback) {
}
void VideoFrameCompositor::Stop() {
- TRACE_EVENT_ASYNC_END0("media,rail", "VideoPlayback",
- static_cast<const void*>(this));
+ persistent_async_->End();
// 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