Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/browser/android/child_process_launcher_android.cc

Issue 2705133002: android: Allow registering multiple CreationParams (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ScopedJavaLocalRef<jobject> j_file_info = 85 ScopedJavaLocalRef<jobject> j_file_info =
86 Java_ChildProcessLauncher_makeFdInfo(env, id, fd, auto_close, 86 Java_ChildProcessLauncher_makeFdInfo(env, id, fd, auto_close,
87 region.offset, region.size); 87 region.offset, region.size);
88 PCHECK(j_file_info.obj()); 88 PCHECK(j_file_info.obj());
89 env->SetObjectArrayElement(j_file_infos.obj(), i, j_file_info.obj()); 89 env->SetObjectArrayElement(j_file_infos.obj(), i, j_file_info.obj());
90 if (auto_close) { 90 if (auto_close) {
91 ignore_result(files_to_register->ReleaseFD(fd).release()); 91 ignore_result(files_to_register->ReleaseFD(fd).release());
92 } 92 }
93 } 93 }
94 94
95 constexpr int param_key = 0; // TODO(boliu): Use this.
95 Java_ChildProcessLauncher_start( 96 Java_ChildProcessLauncher_start(
96 env, base::android::GetApplicationContext(), j_argv, child_process_id, 97 env, base::android::GetApplicationContext(), param_key, j_argv,
97 j_file_infos, 98 child_process_id, j_file_infos,
98 reinterpret_cast<intptr_t>(new StartChildProcessCallback(callback))); 99 reinterpret_cast<intptr_t>(new StartChildProcessCallback(callback)));
99 } 100 }
100 101
101 void StopChildProcess(base::ProcessHandle handle) { 102 void StopChildProcess(base::ProcessHandle handle) {
102 JNIEnv* env = AttachCurrentThread(); 103 JNIEnv* env = AttachCurrentThread();
103 DCHECK(env); 104 DCHECK(env);
104 Java_ChildProcessLauncher_stop(env, static_cast<jint>(handle)); 105 Java_ChildProcessLauncher_stop(env, static_cast<jint>(handle));
105 } 106 }
106 107
107 bool IsChildProcessOomProtected(base::ProcessHandle handle) { 108 bool IsChildProcessOomProtected(base::ProcessHandle handle) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 gl::ScopedJavaSurface surface_view = 151 gl::ScopedJavaSurface surface_view =
151 gpu::GpuSurfaceTracker::GetInstance()->AcquireJavaSurface(surface_id); 152 gpu::GpuSurfaceTracker::GetInstance()->AcquireJavaSurface(surface_id);
152 return base::android::ScopedJavaLocalRef<jobject>(surface_view.j_surface()); 153 return base::android::ScopedJavaLocalRef<jobject>(surface_view.j_surface());
153 } 154 }
154 155
155 bool RegisterChildProcessLauncher(JNIEnv* env) { 156 bool RegisterChildProcessLauncher(JNIEnv* env) {
156 return RegisterNativesImpl(env); 157 return RegisterNativesImpl(env);
157 } 158 }
158 159
159 } // namespace content 160 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698