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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 jobject GetViewSurface(JNIEnv* env, jclass clazz, jint surface_id) { | 154 jobject GetViewSurface(JNIEnv* env, jclass clazz, jint surface_id) { |
155 // This is a synchronous call from the GPU process and is expected to be | 155 // This is a synchronous call from the GPU process and is expected to be |
156 // handled on a binder thread. Handling this on the UI thread will lead | 156 // handled on a binder thread. Handling this on the UI thread will lead |
157 // to deadlocks. | 157 // to deadlocks. |
158 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); | 158 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
159 return CompositorImpl::GetSurface(surface_id); | 159 return CompositorImpl::GetSurface(surface_id); |
160 } | 160 } |
161 | 161 |
| 162 jobject GetSurfaceTextureSurface(JNIEnv* env, |
| 163 jclass clazz, |
| 164 jint surface_texture_id) { |
| 165 // This is a synchronous call from a renderer process and is expected to be |
| 166 // handled on a binder thread. Handling this on the UI thread will lead |
| 167 // to deadlocks. |
| 168 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 169 return CompositorImpl::GetSurfaceTextureSurface(surface_texture_id); |
| 170 } |
| 171 |
162 jboolean IsSingleProcess(JNIEnv* env, jclass clazz) { | 172 jboolean IsSingleProcess(JNIEnv* env, jclass clazz) { |
163 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 173 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); |
164 } | 174 } |
165 | 175 |
166 bool RegisterChildProcessLauncher(JNIEnv* env) { | 176 bool RegisterChildProcessLauncher(JNIEnv* env) { |
167 return RegisterNativesImpl(env); | 177 return RegisterNativesImpl(env); |
168 } | 178 } |
169 | 179 |
170 } // namespace content | 180 } // namespace content |
OLD | NEW |