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

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

Issue 298253004: Don't background processes with active audio output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 6 years, 7 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 | « no previous file | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 60556ee81df13c746bbfdffffd5845146eba90f1..2e80ea6e5fb516e9333e1e226f2a6dbdcc9d9af6 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_renderer_host.h
@@ -39,6 +39,7 @@
#include <map>
+#include "base/atomic_ref_count.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -84,6 +85,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
virtual void OnDestruct() const OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ // Returns true if any streams managed by this host are actively playing.
jam 2014/05/29 17:31:19 nit: add a comment that this is a thread safe meth
DaleCurtis 2014/05/29 18:57:13 Done.
+ bool HasActiveAudio();
+
private:
friend class AudioRendererHostTest;
friend class BrowserThread;
@@ -165,6 +169,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// A map of stream IDs to audio sources.
AudioEntryMap audio_entries_;
+ // The number of streams in the playing state.
+ base::AtomicRefCount num_playing_streams_;
scherkus (not reviewing) 2014/05/29 02:24:42 AtomicRefCount because of IO vs. UI thread?
DaleCurtis 2014/05/29 18:57:13 Correct.
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
};
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698