Index: content/browser/web_contents/web_contents_impl.h |
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h |
index ae57bea44335669fdfcf1157d282f71fb5943e0a..69b40aad845d86260f7a82a9dfbe97ea0f9da9ef 100644 |
--- a/content/browser/web_contents/web_contents_impl.h |
+++ b/content/browser/web_contents/web_contents_impl.h |
@@ -22,7 +22,7 @@ |
#include "content/browser/frame_host/navigator_delegate.h" |
#include "content/browser/frame_host/render_frame_host_delegate.h" |
#include "content/browser/frame_host/render_frame_host_manager.h" |
-#include "content/browser/media/audio_stream_monitor.h" |
+#include "content/browser/media/audio_state_provider.h" |
#include "content/browser/renderer_host/render_view_host_delegate.h" |
#include "content/browser/renderer_host/render_widget_host_delegate.h" |
#include "content/common/accessibility_mode_enums.h" |
@@ -140,6 +140,11 @@ class CONTENT_EXPORT WebContentsImpl |
// TODO(creis): Remove this now that we can get to it via FrameTreeNode. |
RenderFrameHostManager* GetRenderManagerForTesting(); |
+ // Lets the test replace the audio state provider. Takes ownership over |
+ // provider. This is used to test AudioStreamMonitor on Android where |
+ // we normaly don't do monitoring. |
+ void SetAudioStateProviderForTesting(AudioStateProvider* provider); |
no sievers
2015/03/02 20:21:24
If you pass a scoped_ptr<> you don't need to comme
Tima Vaisburd
2015/03/02 21:03:03
Yes, I will happily disable AudioStreamMonitor tes
Tima Vaisburd
2015/03/02 22:16:10
Excluded in .gypi
|
+ |
// Returns guest browser plugin object, or NULL if this WebContents is not a |
// guest. |
BrowserPluginGuest* GetBrowserPluginGuest() const; |
@@ -666,8 +671,8 @@ class CONTENT_EXPORT WebContentsImpl |
// Forces overscroll to be disabled (used by touch emulation). |
void SetForceDisableOverscrollContent(bool force_disable); |
- AudioStreamMonitor* audio_stream_monitor() { |
- return &audio_stream_monitor_; |
+ AudioStateProvider* audio_state_provider() { |
+ return audio_state_provider_.get(); |
} |
bool has_audio_power_save_blocker_for_testing() const { |
@@ -1022,6 +1027,11 @@ class CONTENT_EXPORT WebContentsImpl |
scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; |
scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
+ // Tells whether this WebContents is actively producing sound. |
+ // Order is important: the |frame_tree_| destruction uses |
+ // |audio_state_provider_|. |
+ scoped_ptr<AudioStateProvider> audio_state_provider_; |
+ |
// Manages the frame tree of the page and process swaps in each node. |
FrameTree frame_tree_; |
@@ -1236,9 +1246,6 @@ class CONTENT_EXPORT WebContentsImpl |
// is created, and broadcast to all frames when it changes. |
AccessibilityMode accessibility_mode_; |
- // Monitors power levels for audio streams associated with this WebContents. |
- AudioStreamMonitor audio_stream_monitor_; |
- |
// Created on-demand to mute all audio output from this WebContents. |
scoped_ptr<WebContentsAudioMuter> audio_muter_; |