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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.h

Issue 562273008: Add audio signal to the ResourceScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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: content/browser/renderer_host/media/audio_renderer_host.h
diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h
index f4be17f1f2cc8bef9f6a657e8644fb8f9117a811..8959cdddcbc374e41c6566a78e28dd6ee89774ae 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_renderer_host.h
@@ -89,6 +89,10 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// be called from any thread.
bool HasActiveAudio();
+ // Returns true if any streams managed by the RenderView identified by
+ // |render_view_id| are actively playing. Can be called from any thread.
+ bool RenderViewHasActiveAudio(int render_view_id) const;
+
private:
friend class AudioRendererHostTest;
friend class BrowserThread;
@@ -157,6 +161,10 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// Returns NULL if not found.
AudioEntry* LookupById(int stream_id);
+ // A helper method to update the number of playing streams and alert the
+ // ResourceScheduler when the renderer starts or stops playing an audiostream.
+ void UpdateNumPlayingStreams(AudioEntry* entry, bool is_playing);
+
// ID of the RenderProcessHost that owns this instance.
const int render_process_id_;
« no previous file with comments | « content/browser/loader/resource_scheduler_unittest.cc ('k') | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698