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

Unified Diff: media/renderers/video_renderer_impl.cc

Issue 1409123005: Add methods for telling V8 how much memory audio/video is using. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix html viewer. Created 5 years, 2 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
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.cc
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc
index 3596ece66fdc57363eed4df8c6cf21e6dfa1ce52..fe724cb2448ac401543926d4b4a79a5a784841f6 100644
--- a/media/renderers/video_renderer_impl.cc
+++ b/media/renderers/video_renderer_impl.cc
@@ -54,6 +54,7 @@ VideoRendererImpl::VideoRendererImpl(
time_progressing_(false),
render_first_frame_and_stop_(false),
posted_maybe_stop_after_first_paint_(false),
+ last_video_memory_usage_(0),
weak_factory_(this) {
if (gpu_factories &&
gpu_factories->ShouldUseGpuMemoryBuffersForVideoFrames()) {
@@ -550,10 +551,14 @@ void VideoRendererImpl::UpdateStats_Locked() {
PipelineStatistics statistics;
statistics.video_frames_decoded = frames_decoded_;
statistics.video_frames_dropped = frames_dropped_;
- task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics));
+ const size_t memory_usage = algorithm_->GetMemoryUsage();
+ statistics.video_memory_usage = memory_usage - last_video_memory_usage_;
+
+ task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics));
frames_decoded_ = 0;
frames_dropped_ = 0;
+ last_video_memory_usage_ = memory_usage;
}
}
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698