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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1292433002: Defer media playback in background tabs. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 5 years, 4 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/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 05e6ad6f8c49c076f229b9ebe655ec73dbc4ad97..d29b7009063fc17cf45a7d826d6b104ae4644457 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -676,6 +676,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
#if defined(VIDEO_HOLE)
contains_media_player_(false),
#endif
+ has_played_media_(false),
devtools_agent_(nullptr),
geolocation_dispatcher_(NULL),
push_messaging_dispatcher_(NULL),
@@ -2041,7 +2042,7 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
media::WebMediaPlayerParams params(
base::Bind(&ContentRendererClient::DeferMediaLoad,
base::Unretained(GetContentClient()->renderer()),
- static_cast<RenderFrame*>(this)),
+ static_cast<RenderFrame*>(this), has_played_media_),
render_thread->GetAudioRendererMixerManager()->CreateInput(routing_id_),
media_log, render_thread->GetMediaThreadTaskRunner(),
render_thread->compositor_task_runner(),
@@ -3827,6 +3828,7 @@ blink::WebVRClient* RenderFrameImpl::webVRClient() {
#endif
void RenderFrameImpl::DidPlay(WebMediaPlayer* player) {
+ has_played_media_ = true;
Send(new FrameHostMsg_MediaPlayingNotification(
routing_id_, reinterpret_cast<int64>(player), player->hasVideo(),
player->hasAudio(), player->isRemote()));
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698