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/common/android/surface_texture_listener.h" | 5 #include "content/common/android/surface_texture_listener.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "content/common/android/surface_texture_bridge.h" | 10 #include "content/common/android/surface_texture_bridge.h" |
11 #include "jni/surface_texture_listener_jni.h" | 11 #include "jni/SurfaceTextureListener_jni.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 // static | 15 // static |
16 jobject SurfaceTextureListener::CreateSurfaceTextureListener( | 16 jobject SurfaceTextureListener::CreateSurfaceTextureListener( |
17 JNIEnv* env, | 17 JNIEnv* env, |
18 const base::Closure& callback) { | 18 const base::Closure& callback) { |
19 // The java listener object owns and releases the native instance. | 19 // The java listener object owns and releases the native instance. |
20 // This is necessary to avoid races with incoming notifications. | 20 // This is necessary to avoid races with incoming notifications. |
21 ScopedJavaLocalRef<jobject> listener(Java_SurfaceTextureListener_create(env, | 21 ScopedJavaLocalRef<jobject> listener(Java_SurfaceTextureListener_create(env, |
(...skipping 21 matching lines...) Expand all Loading... |
43 DCHECK(!browser_loop_->BelongsToCurrentThread()); | 43 DCHECK(!browser_loop_->BelongsToCurrentThread()); |
44 browser_loop_->PostTask(FROM_HERE, callback_); | 44 browser_loop_->PostTask(FROM_HERE, callback_); |
45 } | 45 } |
46 | 46 |
47 // static | 47 // static |
48 bool SurfaceTextureListener::RegisterSurfaceTextureListener(JNIEnv* env) { | 48 bool SurfaceTextureListener::RegisterSurfaceTextureListener(JNIEnv* env) { |
49 return RegisterNativesImpl(env); | 49 return RegisterNativesImpl(env); |
50 } | 50 } |
51 | 51 |
52 } // namespace content | 52 } // namespace content |
OLD | NEW |