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/app/android/child_process_service_impl.h" | 5 #include "content/app/android/child_process_service_impl.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 #include <cpu-features.h> | 8 #include <cpu-features.h> |
9 | 9 |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
11 #include "base/android/library_loader/library_loader_hooks.h" | 11 #include "base/android/library_loader/library_loader_hooks.h" |
12 #include "base/android/memory_pressure_listener_android.h" | 12 #include "base/android/memory_pressure_listener_android.h" |
| 13 #include "base/android/unguessable_token_android.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/posix/global_descriptors.h" | 16 #include "base/posix/global_descriptors.h" |
16 #include "base/unguessable_token.h" | 17 #include "base/unguessable_token.h" |
17 #include "content/child/child_thread_impl.h" | 18 #include "content/child/child_thread_impl.h" |
18 #include "content/public/common/content_descriptors.h" | 19 #include "content/public/common/content_descriptors.h" |
19 #include "gpu/ipc/common/android/scoped_surface_request_conduit.h" | 20 #include "gpu/ipc/common/android/scoped_surface_request_conduit.h" |
20 #include "gpu/ipc/common/android/surface_texture_manager.h" | 21 #include "gpu/ipc/common/android/surface_texture_manager.h" |
21 #include "gpu/ipc/common/android/surface_texture_peer.h" | 22 #include "gpu/ipc/common/android/surface_texture_peer.h" |
22 #include "gpu/ipc/common/gpu_surface_lookup.h" | 23 #include "gpu/ipc/common/gpu_surface_lookup.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 104 } |
104 | 105 |
105 // Overriden from ScopedSurfaceRequestConduit: | 106 // Overriden from ScopedSurfaceRequestConduit: |
106 void ForwardSurfaceTextureForSurfaceRequest( | 107 void ForwardSurfaceTextureForSurfaceRequest( |
107 const base::UnguessableToken& request_token, | 108 const base::UnguessableToken& request_token, |
108 const gl::SurfaceTexture* surface_texture) override { | 109 const gl::SurfaceTexture* surface_texture) override { |
109 JNIEnv* env = base::android::AttachCurrentThread(); | 110 JNIEnv* env = base::android::AttachCurrentThread(); |
110 | 111 |
111 content:: | 112 content:: |
112 Java_ChildProcessServiceImpl_forwardSurfaceTextureForSurfaceRequest( | 113 Java_ChildProcessServiceImpl_forwardSurfaceTextureForSurfaceRequest( |
113 env, service_impl_, request_token.GetHighForSerialization(), | 114 env, service_impl_, |
114 request_token.GetLowForSerialization(), | 115 base::android::UnguessableTokenAndroid::Create(env, request_token), |
115 surface_texture->j_surface_texture()); | 116 surface_texture->j_surface_texture()); |
116 } | 117 } |
117 | 118 |
118 // Overridden from GpuSurfaceLookup: | 119 // Overridden from GpuSurfaceLookup: |
119 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override { | 120 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override { |
120 JNIEnv* env = base::android::AttachCurrentThread(); | 121 JNIEnv* env = base::android::AttachCurrentThread(); |
121 gl::ScopedJavaSurface surface( | 122 gl::ScopedJavaSurface surface( |
122 content::Java_ChildProcessServiceImpl_getViewSurface(env, service_impl_, | 123 content::Java_ChildProcessServiceImpl_getViewSurface(env, service_impl_, |
123 surface_id)); | 124 surface_id)); |
124 | 125 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 193 |
193 bool RegisterChildProcessServiceImpl(JNIEnv* env) { | 194 bool RegisterChildProcessServiceImpl(JNIEnv* env) { |
194 return RegisterNativesImpl(env); | 195 return RegisterNativesImpl(env); |
195 } | 196 } |
196 | 197 |
197 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 198 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
198 ChildThreadImpl::ShutdownThread(); | 199 ChildThreadImpl::ShutdownThread(); |
199 } | 200 } |
200 | 201 |
201 } // namespace content | 202 } // namespace content |
OLD | NEW |