| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/child_process_launcher_helper_android.h" | 5 #include "content/browser/child_process_launcher_helper_android.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/android/apk_assets.h" | 9 #include "base/android/apk_assets.h" |
| 10 #include "base/android/context_utils.h" | |
| 11 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| 12 #include "base/i18n/icu_util.h" | 11 #include "base/i18n/icu_util.h" |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 15 #include "content/browser/child_process_launcher_helper.h" | 14 #include "content/browser/child_process_launcher_helper.h" |
| 16 #include "content/browser/child_process_launcher_helper_posix.h" | 15 #include "content/browser/child_process_launcher_helper_posix.h" |
| 17 #include "content/browser/file_descriptor_info_impl.h" | 16 #include "content/browser/file_descriptor_info_impl.h" |
| 18 #include "content/browser/web_contents/web_contents_impl.h" | 17 #include "content/browser/web_contents/web_contents_impl.h" |
| 19 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 region.offset, region.size); | 125 region.offset, region.size); |
| 127 PCHECK(j_file_info.obj()); | 126 PCHECK(j_file_info.obj()); |
| 128 env->SetObjectArrayElement(j_file_infos.obj(), i, j_file_info.obj()); | 127 env->SetObjectArrayElement(j_file_infos.obj(), i, j_file_info.obj()); |
| 129 if (auto_close) { | 128 if (auto_close) { |
| 130 ignore_result(files_to_register->ReleaseFD(fd).release()); | 129 ignore_result(files_to_register->ReleaseFD(fd).release()); |
| 131 } | 130 } |
| 132 } | 131 } |
| 133 | 132 |
| 134 constexpr int param_key = 0; // TODO(boliu): Use this. | 133 constexpr int param_key = 0; // TODO(boliu): Use this. |
| 135 java_peer_.Reset(Java_ChildProcessLauncherHelper_create( | 134 java_peer_.Reset(Java_ChildProcessLauncherHelper_create( |
| 136 env, reinterpret_cast<intptr_t>(this), | 135 env, reinterpret_cast<intptr_t>(this), param_key, j_argv, |
| 137 base::android::GetApplicationContext(), param_key, j_argv, | |
| 138 child_process_id(), j_file_infos)); | 136 child_process_id(), j_file_infos)); |
| 139 AddRef(); // Balanced by OnChildProcessStarted. | 137 AddRef(); // Balanced by OnChildProcessStarted. |
| 140 | 138 |
| 141 return Process(); | 139 return Process(); |
| 142 } | 140 } |
| 143 | 141 |
| 144 void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( | 142 void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( |
| 145 const ChildProcessLauncherHelper::Process& process, | 143 const ChildProcessLauncherHelper::Process& process, |
| 146 const base::LaunchOptions& options) { | 144 const base::LaunchOptions& options) { |
| 147 } | 145 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 AttachCurrentThread())); | 245 AttachCurrentThread())); |
| 248 } | 246 } |
| 249 | 247 |
| 250 } // namespace internal | 248 } // namespace internal |
| 251 | 249 |
| 252 bool RegisterChildProcessLauncher(JNIEnv* env) { | 250 bool RegisterChildProcessLauncher(JNIEnv* env) { |
| 253 return internal::RegisterNativesImpl(env); | 251 return internal::RegisterNativesImpl(env); |
| 254 } | 252 } |
| 255 | 253 |
| 256 } // namespace content | 254 } // namespace content |
| OLD | NEW |