| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 jlong client_context, | 93 jlong client_context, |
| 94 jint handle) { | 94 jint handle) { |
| 95 StartChildProcessCallback* callback = | 95 StartChildProcessCallback* callback = |
| 96 reinterpret_cast<StartChildProcessCallback*>(client_context); | 96 reinterpret_cast<StartChildProcessCallback*>(client_context); |
| 97 if (handle) | 97 if (handle) |
| 98 callback->Run(static_cast<base::ProcessHandle>(handle)); | 98 callback->Run(static_cast<base::ProcessHandle>(handle)); |
| 99 delete callback; | 99 delete callback; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void StartChildProcess( | 102 void StartChildProcess( |
| 103 const CommandLine::StringVector& argv, | 103 const base::CommandLine::StringVector& argv, |
| 104 int child_process_id, | 104 int child_process_id, |
| 105 const std::vector<content::FileDescriptorInfo>& files_to_register, | 105 const std::vector<content::FileDescriptorInfo>& files_to_register, |
| 106 const StartChildProcessCallback& callback) { | 106 const StartChildProcessCallback& callback) { |
| 107 JNIEnv* env = AttachCurrentThread(); | 107 JNIEnv* env = AttachCurrentThread(); |
| 108 DCHECK(env); | 108 DCHECK(env); |
| 109 | 109 |
| 110 // Create the Command line String[] | 110 // Create the Command line String[] |
| 111 ScopedJavaLocalRef<jobjectArray> j_argv = ToJavaArrayOfStrings(env, argv); | 111 ScopedJavaLocalRef<jobjectArray> j_argv = ToJavaArrayOfStrings(env, argv); |
| 112 | 112 |
| 113 size_t file_count = files_to_register.size(); | 113 size_t file_count = files_to_register.size(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 void UnregisterChildProcessSurfaceTexture(int surface_texture_id, | 205 void UnregisterChildProcessSurfaceTexture(int surface_texture_id, |
| 206 int child_process_id) { | 206 int child_process_id) { |
| 207 JNIEnv* env = AttachCurrentThread(); | 207 JNIEnv* env = AttachCurrentThread(); |
| 208 DCHECK(env); | 208 DCHECK(env); |
| 209 Java_ChildProcessLauncher_unregisterSurfaceTexture( | 209 Java_ChildProcessLauncher_unregisterSurfaceTexture( |
| 210 env, surface_texture_id, child_process_id); | 210 env, surface_texture_id, child_process_id); |
| 211 } | 211 } |
| 212 | 212 |
| 213 jboolean IsSingleProcess(JNIEnv* env, jclass clazz) { | 213 jboolean IsSingleProcess(JNIEnv* env, jclass clazz) { |
| 214 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 214 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 215 switches::kSingleProcess); |
| 215 } | 216 } |
| 216 | 217 |
| 217 bool RegisterChildProcessLauncher(JNIEnv* env) { | 218 bool RegisterChildProcessLauncher(JNIEnv* env) { |
| 218 return RegisterNativesImpl(env); | 219 return RegisterNativesImpl(env); |
| 219 } | 220 } |
| 220 | 221 |
| 221 } // namespace content | 222 } // namespace content |
| OLD | NEW |