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

Side by Side 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: Fix. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 GetProcess()->EnableSendQueue(); 203 GetProcess()->EnableSendQueue();
204 204
205 if (swapped_out) { 205 if (swapped_out) {
206 rvh_state_ = STATE_SWAPPED_OUT; 206 rvh_state_ = STATE_SWAPPED_OUT;
207 } else { 207 } else {
208 rvh_state_ = STATE_DEFAULT; 208 rvh_state_ = STATE_DEFAULT;
209 instance_->increment_active_view_count(); 209 instance_->increment_active_view_count();
210 } 210 }
211 211
212 if (ResourceDispatcherHostImpl::Get()) { 212 if (ResourceDispatcherHostImpl::Get()) {
213 scoped_refptr<AudioRendererHost> audio_host =
214 static_cast<RenderProcessHostImpl*>(GetProcess())
215 ->audio_renderer_host();
213 BrowserThread::PostTask( 216 BrowserThread::PostTask(
214 BrowserThread::IO, FROM_HERE, 217 BrowserThread::IO,
218 FROM_HERE,
215 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, 219 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated,
216 base::Unretained(ResourceDispatcherHostImpl::Get()), 220 base::Unretained(ResourceDispatcherHostImpl::Get()),
217 GetProcess()->GetID(), GetRoutingID(), !is_hidden())); 221 GetProcess()->GetID(),
222 GetRoutingID(),
223 !is_hidden(),
224 audio_host.get()
225 ? audio_host->RenderViewHasActiveAudio(GetRoutingID())
226 : false));
218 } 227 }
219 228
220 #if defined(ENABLE_BROWSER_CDMS) 229 #if defined(ENABLE_BROWSER_CDMS)
221 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); 230 media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
222 #endif 231 #endif
223 232
224 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( 233 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind(
225 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true))); 234 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true)));
226 } 235 }
227 236
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 FrameTree* frame_tree = delegate_->GetFrameTree(); 1517 FrameTree* frame_tree = delegate_->GetFrameTree();
1509 1518
1510 frame_tree->ResetForMainFrameSwap(); 1519 frame_tree->ResetForMainFrameSwap();
1511 } 1520 }
1512 1521
1513 void RenderViewHostImpl::SelectWordAroundCaret() { 1522 void RenderViewHostImpl::SelectWordAroundCaret() {
1514 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1523 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1515 } 1524 }
1516 1525
1517 } // namespace content 1526 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698