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

Unified Diff: content/browser/android/child_process_launcher_android.cc

Issue 2594203004: Unifying ChildProcessLauncher across platforms. (Closed)
Patch Set: Clean-up. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/child_process_launcher_android.cc
diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android.cc
index a196b1abd438031f195bdec4f28c02dceae5c91a..ceb9a28b028e602d0079566409ac32614a297c62 100644
--- a/content/browser/android/child_process_launcher_android.cc
+++ b/content/browser/android/child_process_launcher_android.cc
@@ -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);
+ const auto& region = files_to_register->GetRegionAt(i);
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) {
« no previous file with comments | « content/browser/android/child_process_launcher_android.h ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698