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_ |