Index: media/blink/webmediaplayer_impl.h |
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h |
index 75e538afa3260f73e47ebfe8ce72297b8258545b..e839268d81b54e334669cadf9c2fb444e793e917 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,12 @@ class MEDIA_EXPORT WebMediaPlayerImpl |
WebMediaPlayerParams::DeferLoadCB defer_load_cb_; |
WebMediaPlayerParams::Context3DCB context_3d_cb_; |
+ // Members for notifying upstream clients about internal memory usage. The |
+ // |adjust_allocated_memory_cb_| must only be called on |main_task_runner_|. |
+ 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_; |