| Index: content/browser/android/content_video_view.cc
|
| diff --git a/content/browser/android/content_video_view.cc b/content/browser/android/content_video_view.cc
|
| index 4df61ff7e6f0daac808093305d4899180b3eaa42..74d75a17944d3cf6fe59152296b2baf7871ecd90 100644
|
| --- a/content/browser/android/content_video_view.cc
|
| +++ b/content/browser/android/content_video_view.cc
|
| @@ -48,14 +48,12 @@ ContentVideoView* ContentVideoView::GetInstance() {
|
| return g_content_video_view;
|
| }
|
|
|
| -ContentVideoView::ContentVideoView(Client* client,
|
| - ContentViewCore* content_view_core,
|
| - const JavaRef<jobject>& video_embedder,
|
| - const gfx::Size& video_natural_size)
|
| - : client_(client), weak_factory_(this) {
|
| +ContentVideoView::ContentVideoView(ContentViewCore* content_view_core,
|
| + const JavaRef<jobject>& video_embedder)
|
| + : cvc_(content_view_core),
|
| + j_content_video_view_embedder_(video_embedder),
|
| + weak_factory_(this) {
|
| DCHECK(!g_content_video_view);
|
| - j_content_video_view_ =
|
| - CreateJavaObject(content_view_core, video_embedder, video_natural_size);
|
| g_content_video_view = this;
|
| }
|
|
|
| @@ -97,6 +95,12 @@ void ContentVideoView::OnVideoSizeChanged(int width, int height) {
|
| }
|
| }
|
|
|
| +void ContentVideoView::CreateVideoSurface(VideoSurfaceProvider::Client* client,
|
| + const gfx::Size& video_natural_size) {
|
| + client_ = client;
|
| + j_content_video_view_ = CreateJavaObject(video_natural_size);
|
| +}
|
| +
|
| void ContentVideoView::ExitFullscreen() {
|
| JNIEnv* env = AttachCurrentThread();
|
| ScopedJavaLocalRef<jobject> content_video_view = GetJavaObject(env);
|
| @@ -163,19 +167,17 @@ void ContentVideoView::RecordExitFullscreenPlayback(
|
| }
|
|
|
| JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject(
|
| - ContentViewCore* content_view_core,
|
| - const JavaRef<jobject>& j_content_video_view_embedder,
|
| const gfx::Size& video_natural_size) {
|
| JNIEnv* env = AttachCurrentThread();
|
| base::android::ScopedJavaLocalRef<jobject> j_content_view_core =
|
| - content_view_core->GetJavaObject();
|
| + cvc_->GetJavaObject();
|
|
|
| if (j_content_view_core.is_null())
|
| return JavaObjectWeakGlobalRef(env, nullptr);
|
|
|
| return JavaObjectWeakGlobalRef(
|
| env, Java_ContentVideoView_createContentVideoView(
|
| - env, j_content_view_core, j_content_video_view_embedder,
|
| + env, j_content_view_core, j_content_video_view_embedder_,
|
| reinterpret_cast<intptr_t>(this),
|
| video_natural_size.width(), video_natural_size.height())
|
| .obj());
|
|
|