Chromium Code Reviews| Index: content/browser/android/child_process_launcher_android_jni.cc |
| diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android_jni.cc |
| similarity index 94% |
| rename from content/browser/android/child_process_launcher_android.cc |
| rename to content/browser/android/child_process_launcher_android_jni.cc |
| index a196b1abd438031f195bdec4f28c02dceae5c91a..dbe5b11078ba8799ddd0d1785297b57246daa6d4 100644 |
| --- a/content/browser/android/child_process_launcher_android.cc |
| +++ b/content/browser/android/child_process_launcher_android_jni.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "content/browser/android/child_process_launcher_android.h" |
| +#include "content/browser/android/child_process_launcher_android_jni.h" |
| #include <stddef.h> |
| #include <stdint.h> |
| @@ -21,7 +21,6 @@ |
| #include "content/browser/media/android/media_web_contents_observer_android.h" |
| #include "content/browser/web_contents/web_contents_impl.h" |
| #include "content/public/browser/browser_thread.h" |
| -#include "content/public/browser/render_process_host.h" |
| #include "content/public/common/content_switches.h" |
| #include "gpu/ipc/common/gpu_surface_tracker.h" |
| #include "jni/ChildProcessLauncher_jni.h" |
| @@ -104,15 +103,17 @@ static void OnChildProcessStarted(JNIEnv*, |
| jint handle) { |
| StartChildProcessCallback* callback = |
| reinterpret_cast<StartChildProcessCallback*>(client_context); |
| - if (handle) |
| - callback->Run(static_cast<base::ProcessHandle>(handle)); |
| + int launch_result = (handle == base::kNullProcessHandle) |
| + ? LAUNCH_RESULT_FAILURE |
| + : LAUNCH_RESULT_SUCCESS; |
| + callback->Run(static_cast<base::ProcessHandle>(handle), launch_result); |
| delete callback; |
| } |
| void StartChildProcess( |
| const base::CommandLine::StringVector& argv, |
| int child_process_id, |
| - std::unique_ptr<content::FileDescriptorInfo> files_to_register, |
| + content::FileDescriptorInfo* files_to_register, |
| const StartChildProcessCallback& callback) { |
| JNIEnv* env = AttachCurrentThread(); |
| DCHECK(env); |
| @@ -133,14 +134,11 @@ void StartChildProcess( |
| int fd = files_to_register->GetFDAt(i); |
| PCHECK(0 <= fd); |
| int id = files_to_register->GetIDAt(i); |
| + auto region = files_to_register->GetRegionAt(i); |
|
boliu
2017/01/12 02:00:07
I'm no c++11 expert, but I think this should be "c
Jay Civelli
2017/01/12 23:05:40
Done.
|
| bool auto_close = files_to_register->OwnsFD(fd); |
| - const base::MemoryMappedFile::Region& region = |
| - files_to_register->GetRegionAt(i); |
| - int64_t offset = region.offset; |
| - int64_t size = region.size; |
| ScopedJavaLocalRef<jobject> j_file_info = |
| - Java_ChildProcessLauncher_makeFdInfo(env, id, fd, auto_close, offset, |
| - size); |
| + Java_ChildProcessLauncher_makeFdInfo(env, id, fd, auto_close, |
| + region.offset, region.size); |
| PCHECK(j_file_info.obj()); |
| env->SetObjectArrayElement(j_file_infos.obj(), i, j_file_info.obj()); |
| if (auto_close) { |