| 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.h" | 5 #include "content/app/android/child_process_service.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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace <anonymous> | 149 } // namespace <anonymous> |
| 150 | 150 |
| 151 void RegisterGlobalFileDescriptor(JNIEnv* env, | 151 void RegisterGlobalFileDescriptor(JNIEnv* env, |
| 152 jclass clazz, | 152 jclass clazz, |
| 153 jint id, | 153 jint id, |
| 154 jint fd, | 154 jint fd, |
| 155 jlong offset, | 155 jlong offset, |
| 156 jlong size) { | 156 jlong size) { |
| 157 base::MemoryMappedFile::Region region(offset, size); | 157 base::MemoryMappedFile::Region region = {offset, size}; |
| 158 base::GlobalDescriptors::GetInstance()->Set(id, fd, region); | 158 base::GlobalDescriptors::GetInstance()->Set(id, fd, region); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void InitChildProcess(JNIEnv* env, | 161 void InitChildProcess(JNIEnv* env, |
| 162 jclass clazz, | 162 jclass clazz, |
| 163 jobject context, | 163 jobject context, |
| 164 jobject service, | 164 jobject service, |
| 165 jint cpu_count, | 165 jint cpu_count, |
| 166 jlong cpu_features) { | 166 jlong cpu_features) { |
| 167 InternalInitChildProcess(env, clazz, context, service, cpu_count, | 167 InternalInitChildProcess(env, clazz, context, service, cpu_count, |
| 168 cpu_features); | 168 cpu_features); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void ExitChildProcess(JNIEnv* env, jclass clazz) { | 171 void ExitChildProcess(JNIEnv* env, jclass clazz) { |
| 172 VLOG(0) << "ChildProcessService: Exiting child process."; | 172 VLOG(0) << "ChildProcessService: Exiting child process."; |
| 173 base::android::LibraryLoaderExitHook(); | 173 base::android::LibraryLoaderExitHook(); |
| 174 _exit(0); | 174 _exit(0); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool RegisterChildProcessService(JNIEnv* env) { | 177 bool RegisterChildProcessService(JNIEnv* env) { |
| 178 return RegisterNativesImpl(env); | 178 return RegisterNativesImpl(env); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ShutdownMainThread(JNIEnv* env, jobject obj) { | 181 void ShutdownMainThread(JNIEnv* env, jobject obj) { |
| 182 ChildThreadImpl::ShutdownThread(); | 182 ChildThreadImpl::ShutdownThread(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace content | 185 } // namespace content |
| OLD | NEW |