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

Unified Diff: chromecast/renderer/cast_media_load_deferrer.h

Issue 824733002: Support for defered media load to cast_content_render_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove render_process_observer (it snuck in). Created 6 years 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: chromecast/renderer/cast_media_load_deferrer.h
diff --git a/chromecast/renderer/cast_media_load_deferrer.h b/chromecast/renderer/cast_media_load_deferrer.h
new file mode 100644
index 0000000000000000000000000000000000000000..5a66ab9e4d03edcbe4c5f39f37879106a0a86ecf
--- /dev/null
+++ b/chromecast/renderer/cast_media_load_deferrer.h
@@ -0,0 +1,35 @@
+// Copyright 2014 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.
+
+#ifndef CHROMECAST_RENDERER_CAST_MEDIA_LOAD_DEFERRER_H_
+#define CHROMECAST_RENDERER_CAST_MEDIA_LOAD_DEFERRER_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "content/public/renderer/render_frame_observer.h"
+
+namespace chromecast {
+
+// Defers media player loading in background web apps until brought into
+// foreground.
+class CastMediaLoadDeferrer : public content::RenderFrameObserver {
+ public:
+ // Will run |closure| to continue loading the media resource once the page is
+ // swapped in.
+ CastMediaLoadDeferrer(content::RenderFrame* render_frame,
+ const base::Closure& closure);
gunsch 2014/12/22 18:25:33 closure --> continue_loading_cb (same name as in .
derekjchow1 2014/12/22 18:34:58 Done.
+ virtual ~CastMediaLoadDeferrer() override;
gunsch 2014/12/22 18:25:33 rm "virtual", just "override" (here and below)
derekjchow1 2014/12/22 18:34:58 Done.
+
+ private:
+ // content::RenderFrameObserver implementation:
+ virtual void WasShown() override;
+
+ base::Closure continue_loading_cb_;
+
+ DISALLOW_COPY_AND_ASSIGN(CastMediaLoadDeferrer);
+};
+
+} // namespace chromecast
+
+#endif // CHROMECAST_RENDERER_CAST_MEDIA_LOAD_DEFERRER_H_

Powered by Google App Engine
This is Rietveld 408576698