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

Unified Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 1293253003: Fix autoplay during prerendering for media elements on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@defer_media
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: content/renderer/media/android/webmediaplayer_android.h
diff --git a/content/renderer/media/android/webmediaplayer_android.h b/content/renderer/media/android/webmediaplayer_android.h
index a10ad3274e80349809d8f78c62ab05ebccd8a2dc..a1762394142c7a54705b11aefd32f1e803d3a0e2 100644
--- a/content/renderer/media/android/webmediaplayer_android.h
+++ b/content/renderer/media/android/webmediaplayer_android.h
@@ -28,6 +28,7 @@
#include "media/base/demuxer_stream.h"
#include "media/base/media_keys.h"
#include "media/base/time_delta_interpolator.h"
+#include "media/blink/webmediaplayer_params.h"
#include "media/blink/webmediaplayer_util.h"
#include "media/cdm/proxy_decryptor.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
@@ -94,11 +95,8 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
base::WeakPtr<media::WebMediaPlayerDelegate> delegate,
RendererMediaPlayerManager* player_manager,
media::CdmFactory* cdm_factory,
- media::MediaPermission* media_permission,
- blink::WebContentDecryptionModule* initial_cdm,
scoped_refptr<StreamTextureFactory> factory,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- media::MediaLog* media_log);
+ const media::WebMediaPlayerParams& params);
virtual ~WebMediaPlayerAndroid();
// blink::WebMediaPlayer implementation.
@@ -343,6 +341,10 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
// playlist, and record the origin of the player.
void ReportHLSMetrics() const;
+ // Called after |defer_load_cb_| has decided to allow the load. If
+ // |defer_load_cb_| is null this is called immediately.
+ void DoLoad(LoadType load_type, const blink::WebURL& url, CORSMode cors_mode);
+
blink::WebFrame* const frame_;
blink::WebMediaPlayerClient* const client_;
@@ -355,6 +357,10 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
// media tag once http://crbug.com/247892 is fixed.
base::WeakPtr<media::WebMediaPlayerDelegate> delegate_;
+ // Callback responsible for determining if loading of media should be deferred
+ // for external reasons; called during load().
+ media::WebMediaPlayerParams::DeferLoadCB defer_load_cb_;
+
// Save the list of buffered time ranges.
blink::WebTimeRanges buffered_;
@@ -439,7 +445,7 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
// Whether the video size info is available.
bool has_size_info_;
- const scoped_refptr<base::SingleThreadTaskRunner> compositor_loop_;
+ const scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
// Object for allocating stream textures.
scoped_refptr<StreamTextureFactory> stream_texture_factory_;

Powered by Google App Engine
This is Rietveld 408576698