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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

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
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/test/test_render_view_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 712711c77a4302fddc7bf56c9c7bf23d855697bc..7255e34c5b7b73aef6e2574aa95575a760e6f917 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -167,7 +167,8 @@ RenderViewHostImpl::RenderViewHostImpl(
int routing_id,
int main_frame_routing_id,
bool swapped_out,
- bool hidden)
+ bool hidden,
+ bool has_initialized_audio_host)
: RenderWidgetHostImpl(widget_delegate,
instance->GetProcess(),
routing_id,
@@ -196,13 +197,24 @@ RenderViewHostImpl::RenderViewHostImpl(
GetProcess()->EnableSendQueue();
if (ResourceDispatcherHostImpl::Get()) {
+ bool has_active_audio = false;
+ if (has_initialized_audio_host) {
+ scoped_refptr<AudioRendererHost> arh =
+ static_cast<RenderProcessHostImpl*>(GetProcess())
+ ->audio_renderer_host();
+ if (arh.get())
+ has_active_audio = arh->RenderViewHasActiveAudio(GetRoutingID());
+ }
BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
+ BrowserThread::IO,
+ FROM_HERE,
base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated,
base::Unretained(ResourceDispatcherHostImpl::Get()),
- GetProcess()->GetID(), GetRoutingID(), !is_hidden()));
+ GetProcess()->GetID(),
+ GetRoutingID(),
+ !is_hidden(),
+ has_active_audio));
}
-
#if defined(ENABLE_BROWSER_CDMS)
media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
#endif
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/test/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698