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

Unified Diff: media/blink/webmediaplayer_impl.h

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 mock filter. 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
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 6de791d257741aa7f358355fe93ae25d08218ba6..a52d363a10491a7459d2d4792745f72eae534966 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -234,6 +234,10 @@ class MEDIA_EXPORT WebMediaPlayerImpl
// |ended_| state by clamping current time to duration upon |ended_|.
void UpdatePausedTime();
+ // Called at low frequency to tell external observers how much memory we're
+ // using for video playback. Called by |memory_usage_reporting_timer_|.
+ void ReportMemoryUsage();
+
blink::WebLocalFrame* frame_;
// TODO(hclam): get rid of these members and read from the pipeline directly.
@@ -301,6 +305,10 @@ class MEDIA_EXPORT WebMediaPlayerImpl
WebMediaPlayerParams::DeferLoadCB defer_load_cb_;
WebMediaPlayerParams::Context3DCB context_3d_cb_;
+ base::RepeatingTimer memory_usage_reporting_timer_;
+ WebMediaPlayerParams::AdjustAllocatedMemoryCB adjust_allocated_memory_cb_;
+ int64_t last_reported_memory_usage_;
+
// Routes audio playback to either AudioRendererSink or WebAudio.
scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_;

Powered by Google App Engine
This is Rietveld 408576698