summaryrefslogtreecommitdiffstats
path: root/content/app
diff options
context:
space:
mode:
authorqinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 04:38:17 +0000
committerqinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 04:38:17 +0000
commit11387d28032c36724cfe108c544b639c33a6109a (patch)
tree49d99ef2a67d94fe295deb8f01277a33427671cd /content/app
parent51c2e9ad1b2e61ef88fb616c00be7ee11491fd9f (diff)
downloadchromium_src-11387d28032c36724cfe108c544b639c33a6109a.zip
chromium_src-11387d28032c36724cfe108c544b639c33a6109a.tar.gz
chromium_src-11387d28032c36724cfe108c544b639c33a6109a.tar.bz2
Fix a race condition that SurfaceTextureBridge can get released before passing it to the mediaplayer
Use a scoped_refptr to protect SurfaceTextureBridge from being released when DestroyStreamTextureChromium and SetVideoSurface() get called at the same time on GPU and UI thread. Review URL: https://chromiumcodereview.appspot.com/11092010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app')
-rw-r--r--content/app/android/sandboxed_process_service.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/content/app/android/sandboxed_process_service.cc b/content/app/android/sandboxed_process_service.cc
index eb3c299..2b3b2006 100644
--- a/content/app/android/sandboxed_process_service.cc
+++ b/content/app/android/sandboxed_process_service.cc
@@ -30,14 +30,17 @@ class SurfaceTexturePeerSandboxedImpl : public content::SurfaceTexturePeer {
virtual ~SurfaceTexturePeerSandboxedImpl() {
}
- virtual void EstablishSurfaceTexturePeer(base::ProcessHandle pid,
- SurfaceTextureTarget type,
- jobject j_surface_texture,
- int primary_id,
- int secondary_id) {
+ virtual void EstablishSurfaceTexturePeer(
+ base::ProcessHandle pid,
+ SurfaceTextureTarget type,
+ scoped_refptr<content::SurfaceTextureBridge> surface_texture_bridge,
+ int primary_id,
+ int secondary_id) {
JNIEnv* env = base::android::AttachCurrentThread();
content::Java_SandboxedProcessService_establishSurfaceTexturePeer(
- env, service_, pid, type, j_surface_texture, primary_id, secondary_id);
+ env, service_, pid, type,
+ surface_texture_bridge->j_surface_texture().obj(), primary_id,
+ secondary_id);
CheckException(env);
}