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

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: Implement new design 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..e51ab49d0f16feb1f8574257ef6eeece4eb37cd9 100644
--- a/media/blink/video_frame_compositor.cc
+++ b/media/blink/video_frame_compositor.cc
@@ -8,6 +8,9 @@
#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/trace_event_impl.h"
+#include "base/trace_event/trace_log.h"
+#include "base/trace_event/vfc_persistent_async_event.h"
#include "media/base/video_frame.h"
namespace media {
@@ -37,6 +40,11 @@ VideoFrameCompositor::VideoFrameCompositor(
last_interval_(base::TimeDelta::FromSecondsD(1.0 / 60)),
callback_(nullptr) {
background_rendering_timer_.SetTaskRunner(compositor_task_runner_);
+ const void* this_address = static_cast<const void*>(this);
+ persistent_async_ =
+ new base::trace_event::VFCPersistentAsyncEvent((size_t)(this_address));
benjhayden 2016/08/28 05:17:21 Please use a C++ cast instead of C cast per style
alexandermont 2016/08/29 18:59:07 Done
+ base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(
benjhayden 2016/08/28 05:17:21 Can you do this in the PersistentAsyncEvent constr
alexandermont 2016/08/29 18:59:07 Done
+ persistent_async_);
}
VideoFrameCompositor::~VideoFrameCompositor() {
@@ -105,8 +113,7 @@ bool VideoFrameCompositor::HasCurrentFrame() {
}
void VideoFrameCompositor::Start(RenderCallback* callback) {
- TRACE_EVENT_ASYNC_BEGIN0("media,rail", "VideoPlayback",
- 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 +126,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
« base/trace_event/vfc_persistent_async_event.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