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

Side by Side Diff: chromecast/renderer/cast_content_renderer_client.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/renderer/cast_content_renderer_client.h" 5 #include "chromecast/renderer/cast_content_renderer_client.h"
6 6
7 #include <sys/sysinfo.h> 7 #include <sys/sysinfo.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 #endif 204 #endif
205 205
206 blink::WebPrescientNetworking* 206 blink::WebPrescientNetworking*
207 CastContentRendererClient::GetPrescientNetworking() { 207 CastContentRendererClient::GetPrescientNetworking() {
208 return prescient_networking_dispatcher_.get(); 208 return prescient_networking_dispatcher_.get();
209 } 209 }
210 210
211 void CastContentRendererClient::DeferMediaLoad( 211 void CastContentRendererClient::DeferMediaLoad(
212 content::RenderFrame* render_frame, 212 content::RenderFrame* render_frame,
213 bool render_frame_has_played_media_before,
213 const base::Closure& closure) { 214 const base::Closure& closure) {
214 if (!render_frame->IsHidden()) { 215 if (!render_frame->IsHidden()) {
215 closure.Run(); 216 closure.Run();
216 return; 217 return;
217 } 218 }
218 219
219 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. 220 // Lifetime is tied to |render_frame| via content::RenderFrameObserver.
220 new CastMediaLoadDeferrer(render_frame, closure); 221 new CastMediaLoadDeferrer(render_frame, closure);
221 } 222 }
222 223
223 } // namespace shell 224 } // namespace shell
224 } // namespace chromecast 225 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/renderer/cast_content_renderer_client.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698