| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/child_process_launcher_android.h" | 5 #include "content/browser/android/child_process_launcher_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return; | 77 return; |
| 78 } | 78 } |
| 79 | 79 |
| 80 media::MediaPlayerAndroid* player = player_manager->GetPlayer(player_id); | 80 media::MediaPlayerAndroid* player = player_manager->GetPlayer(player_id); |
| 81 if (!player) { | 81 if (!player) { |
| 82 DVLOG(1) << "Cannot find media player for player_id " << player_id; | 82 DVLOG(1) << "Cannot find media player for player_id " << player_id; |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 if (player != player_manager->GetFullscreenPlayer()) { | 86 if (player != player_manager->GetFullscreenPlayer()) { |
| 87 gfx::ScopedJavaSurface scoped_surface(surface); | 87 gl::ScopedJavaSurface scoped_surface(surface); |
| 88 player->SetVideoSurface(std::move(scoped_surface)); | 88 player->SetVideoSurface(std::move(scoped_surface)); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 void LaunchDownloadProcess(base::CommandLine* cmd_line) { | 92 void LaunchDownloadProcess(base::CommandLine* cmd_line) { |
| 93 std::unique_ptr<base::CommandLine> cmd_line_deleter(cmd_line); | 93 std::unique_ptr<base::CommandLine> cmd_line_deleter(cmd_line); |
| 94 | 94 |
| 95 JNIEnv* env = AttachCurrentThread(); | 95 JNIEnv* env = AttachCurrentThread(); |
| 96 DCHECK(env); | 96 DCHECK(env); |
| 97 | 97 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 DCHECK(env); | 240 DCHECK(env); |
| 241 Java_ChildProcessLauncher_registerViewSurface(env, surface_id, j_surface); | 241 Java_ChildProcessLauncher_registerViewSurface(env, surface_id, j_surface); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void UnregisterViewSurface(int surface_id) { | 244 void UnregisterViewSurface(int surface_id) { |
| 245 JNIEnv* env = AttachCurrentThread(); | 245 JNIEnv* env = AttachCurrentThread(); |
| 246 DCHECK(env); | 246 DCHECK(env); |
| 247 Java_ChildProcessLauncher_unregisterViewSurface(env, surface_id); | 247 Java_ChildProcessLauncher_unregisterViewSurface(env, surface_id); |
| 248 } | 248 } |
| 249 | 249 |
| 250 gfx::ScopedJavaSurface GetViewSurface(int surface_id) { | 250 gl::ScopedJavaSurface GetViewSurface(int surface_id) { |
| 251 JNIEnv* env = AttachCurrentThread(); | 251 JNIEnv* env = AttachCurrentThread(); |
| 252 DCHECK(env); | 252 DCHECK(env); |
| 253 return gfx::ScopedJavaSurface::AcquireExternalSurface( | 253 return gl::ScopedJavaSurface::AcquireExternalSurface( |
| 254 Java_ChildProcessLauncher_getViewSurface(env, surface_id).obj()); | 254 Java_ChildProcessLauncher_getViewSurface(env, surface_id).obj()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void CreateSurfaceTextureSurface(int surface_texture_id, | 257 void CreateSurfaceTextureSurface(int surface_texture_id, |
| 258 int client_id, | 258 int client_id, |
| 259 gfx::SurfaceTexture* surface_texture) { | 259 gl::SurfaceTexture* surface_texture) { |
| 260 JNIEnv* env = AttachCurrentThread(); | 260 JNIEnv* env = AttachCurrentThread(); |
| 261 DCHECK(env); | 261 DCHECK(env); |
| 262 Java_ChildProcessLauncher_createSurfaceTextureSurface( | 262 Java_ChildProcessLauncher_createSurfaceTextureSurface( |
| 263 env, | 263 env, |
| 264 surface_texture_id, | 264 surface_texture_id, |
| 265 client_id, | 265 client_id, |
| 266 surface_texture->j_surface_texture().obj()); | 266 surface_texture->j_surface_texture().obj()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id) { | 269 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id) { |
| 270 JNIEnv* env = AttachCurrentThread(); | 270 JNIEnv* env = AttachCurrentThread(); |
| 271 DCHECK(env); | 271 DCHECK(env); |
| 272 Java_ChildProcessLauncher_destroySurfaceTextureSurface( | 272 Java_ChildProcessLauncher_destroySurfaceTextureSurface( |
| 273 env, surface_texture_id, client_id); | 273 env, surface_texture_id, client_id); |
| 274 } | 274 } |
| 275 | 275 |
| 276 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, | 276 gl::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, |
| 277 int client_id) { | 277 int client_id) { |
| 278 JNIEnv* env = AttachCurrentThread(); | 278 JNIEnv* env = AttachCurrentThread(); |
| 279 DCHECK(env); | 279 DCHECK(env); |
| 280 return gfx::ScopedJavaSurface::AcquireExternalSurface( | 280 return gl::ScopedJavaSurface::AcquireExternalSurface( |
| 281 Java_ChildProcessLauncher_getSurfaceTextureSurface( | 281 Java_ChildProcessLauncher_getSurfaceTextureSurface( |
| 282 env, surface_texture_id, client_id).obj()); | 282 env, surface_texture_id, client_id) |
| 283 .obj()); |
| 283 } | 284 } |
| 284 | 285 |
| 285 jboolean IsSingleProcess(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | 286 jboolean IsSingleProcess(JNIEnv* env, const JavaParamRef<jclass>& clazz) { |
| 286 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 287 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 287 switches::kSingleProcess); | 288 switches::kSingleProcess); |
| 288 } | 289 } |
| 289 | 290 |
| 290 bool RegisterChildProcessLauncher(JNIEnv* env) { | 291 bool RegisterChildProcessLauncher(JNIEnv* env) { |
| 291 return RegisterNativesImpl(env); | 292 return RegisterNativesImpl(env); |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace content | 295 } // namespace content |
| OLD | NEW |