| Index: content/browser/android/child_process_launcher_android.cc
|
| diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android.cc
|
| index f7e8437a8e473f5cb31275ecbd5bbebd55c055f0..d5a6d0eca0adc2480db9907642a3b3b4af53d4fb 100644
|
| --- a/content/browser/android/child_process_launcher_android.cc
|
| +++ b/content/browser/android/child_process_launcher_android.cc
|
| @@ -28,6 +28,7 @@
|
| #include "jni/ChildProcessLauncher_jni.h"
|
| #include "media/base/android/media_player_android.h"
|
| #include "ui/gl/android/surface_texture.h"
|
| +#include "media/base/android/media_player_renderer.h"
|
|
|
| using base::android::AttachCurrentThread;
|
| using base::android::ToJavaArrayOfStrings;
|
| @@ -39,6 +40,9 @@ namespace content {
|
|
|
| namespace {
|
|
|
| +// TODO(tguilbert): Uncomment the following code an properly register surface.
|
| +// See crbug.com/627658.
|
| +/*
|
| // Pass a java surface object to the MediaPlayerAndroid object
|
| // identified by render process handle, render frame ID and player ID.
|
| static void SetSurfacePeer(
|
| @@ -88,6 +92,7 @@ static void SetSurfacePeer(
|
| player->SetVideoSurface(std::move(scoped_surface));
|
| }
|
| }
|
| +*/
|
|
|
| void LaunchDownloadProcess(base::CommandLine* cmd_line) {
|
| std::unique_ptr<base::CommandLine> cmd_line_deleter(cmd_line);
|
| @@ -212,11 +217,11 @@ bool IsChildProcessOomProtected(base::ProcessHandle handle) {
|
| }
|
|
|
| void SetChildProcessInForeground(base::ProcessHandle handle,
|
| - bool in_foreground) {
|
| + bool in_foreground) {
|
| JNIEnv* env = AttachCurrentThread();
|
| DCHECK(env);
|
| - return Java_ChildProcessLauncher_setInForeground(env,
|
| - static_cast<jint>(handle), static_cast<jboolean>(in_foreground));
|
| + return Java_ChildProcessLauncher_setInForeground(
|
| + env, static_cast<jint>(handle), static_cast<jboolean>(in_foreground));
|
| }
|
|
|
| void EstablishSurfacePeer(JNIEnv* env,
|
| @@ -225,14 +230,22 @@ void EstablishSurfacePeer(JNIEnv* env,
|
| const JavaParamRef<jobject>& surface,
|
| jint primary_id,
|
| jint secondary_id) {
|
| - ScopedJavaGlobalRef<jobject> jsurface;
|
| - jsurface.Reset(env, surface);
|
| - if (jsurface.is_null())
|
| - return;
|
| -
|
| - DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
|
| - &SetSurfacePeer, jsurface, pid, primary_id, secondary_id));
|
| + DVLOG(1) << "Surface intercepted " << primary_id << " " << secondary_id;
|
| + media::MediaPlayerRenderer::surface_for_prototype =
|
| + gl::ScopedJavaSurface::AcquireExternalSurface(surface);
|
| +
|
| + // DO NOT COMMIT!
|
| + // TODO(tguilbert): Properly register surface and uncomment the code bellow.
|
| + // See crbug.com/627658.
|
| +
|
| + // ScopedJavaGlobalRef<jobject> jsurface;
|
| + // jsurface.Reset(env, surface);
|
| + // if (jsurface.is_null())
|
| + // return;
|
| + //
|
| + // DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + // BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
|
| + // &SetSurfacePeer, jsurface, pid, primary_id, secondary_id));
|
| }
|
|
|
| void RegisterViewSurface(int surface_id, jobject j_surface) {
|
|
|