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

Unified Diff: chrome/renderer/prerender/prerender_media_load_deferrer.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
Index: chrome/renderer/prerender/prerender_media_load_deferrer.cc
diff --git a/chrome/renderer/prerender/prerender_media_load_deferrer.cc b/chrome/renderer/prerender/prerender_media_load_deferrer.cc
deleted file mode 100644
index 93bea76626f7593bb0c37fa54bf6654e7690d723..0000000000000000000000000000000000000000
--- a/chrome/renderer/prerender/prerender_media_load_deferrer.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/renderer/prerender/prerender_media_load_deferrer.h"
-
-#include "base/callback_helpers.h"
-#include "chrome/common/prerender_messages.h"
-
-namespace prerender {
-
-PrerenderMediaLoadDeferrer::PrerenderMediaLoadDeferrer(
- content::RenderFrame* render_frame,
- const base::Closure& closure)
- : RenderFrameObserver(render_frame),
- is_prerendering_(true),
- continue_loading_cb_(closure) {
- DCHECK(!continue_loading_cb_.is_null());
-}
-
-PrerenderMediaLoadDeferrer::~PrerenderMediaLoadDeferrer() {}
-
-bool PrerenderMediaLoadDeferrer::OnMessageReceived(
- const IPC::Message& message) {
- IPC_BEGIN_MESSAGE_MAP(PrerenderMediaLoadDeferrer, message)
- IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering)
- IPC_END_MESSAGE_MAP()
-
- return false;
-}
-
-void PrerenderMediaLoadDeferrer::OnSetIsPrerendering(bool is_prerendering) {
- // Prerendering can only be enabled prior to a RenderFrame's first
- // navigation, so no PrerenderMediaLoadDeferrer should see the notification
- // that enables prerendering.
- DCHECK(!is_prerendering);
- if (!is_prerendering_ || is_prerendering)
- return;
-
- is_prerendering_ = false;
- base::ResetAndReturn(&continue_loading_cb_).Run();
-}
-
-} // namespace prerender
« no previous file with comments | « chrome/renderer/prerender/prerender_media_load_deferrer.h ('k') | chromecast/renderer/cast_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698