| 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" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // Overridden from GpuSurfaceLookup: | 88 // Overridden from GpuSurfaceLookup: |
| 89 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override { | 89 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override { |
| 90 JNIEnv* env = base::android::AttachCurrentThread(); | 90 JNIEnv* env = base::android::AttachCurrentThread(); |
| 91 return gl::ScopedJavaSurface( | 91 return gl::ScopedJavaSurface( |
| 92 content::Java_ChildProcessServiceImpl_getViewSurface(env, service_impl_, | 92 content::Java_ChildProcessServiceImpl_getViewSurface(env, service_impl_, |
| 93 surface_id)); | 93 surface_id)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 friend struct base::DefaultLazyInstanceTraits<ChildProcessSurfaceManager>; | 97 friend struct base::LazyInstanceTraitsBase<ChildProcessSurfaceManager>; |
| 98 // The instance of org.chromium.content.app.ChildProcessServiceImpl. | 98 // The instance of org.chromium.content.app.ChildProcessServiceImpl. |
| 99 base::android::ScopedJavaGlobalRef<jobject> service_impl_; | 99 base::android::ScopedJavaGlobalRef<jobject> service_impl_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(ChildProcessSurfaceManager); | 101 DISALLOW_COPY_AND_ASSIGN(ChildProcessSurfaceManager); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 static base::LazyInstance<ChildProcessSurfaceManager>::Leaky | 104 static base::LazyInstance<ChildProcessSurfaceManager>::Leaky |
| 105 g_child_process_surface_manager = LAZY_INSTANCE_INITIALIZER; | 105 g_child_process_surface_manager = LAZY_INSTANCE_INITIALIZER; |
| 106 | 106 |
| 107 // Chrome actually uses the renderer code path for all of its child | 107 // Chrome actually uses the renderer code path for all of its child |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 bool RegisterChildProcessServiceImpl(JNIEnv* env) { | 187 bool RegisterChildProcessServiceImpl(JNIEnv* env) { |
| 188 return RegisterNativesImpl(env); | 188 return RegisterNativesImpl(env); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 191 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 192 ChildThreadImpl::ShutdownThread(); | 192 ChildThreadImpl::ShutdownThread(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace content | 195 } // namespace content |
| OLD | NEW |