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

Unified Diff: base/test/multiprocess_test_android.cc

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: base/test/multiprocess_test_android.cc
diff --git a/base/test/multiprocess_test_android.cc b/base/test/multiprocess_test_android.cc
index c74f013da1cacc0ca292de356c5ad746c08c5b31..a58968de87ecb6c70cfe7387d214778f6c62c3fa 100644
--- a/base/test/multiprocess_test_android.cc
+++ b/base/test/multiprocess_test_android.cc
@@ -14,6 +14,7 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "jni/LaunchClientResult_jni.h"
#include "jni/MainReturnCodeResult_jni.h"
#include "jni/MultiprocessTestClientLauncher_jni.h"
@@ -25,9 +26,10 @@ namespace base {
// - All options except |fds_to_remap| are ignored.
//
// NOTE: This MUST NOT run on the main thread of the NativeTest application.
-Process SpawnMultiProcessTestChild(const std::string& procname,
- const CommandLine& base_command_line,
- const LaunchOptions& options) {
+SpawnChildResult SpawnMultiProcessTestChild(
+ const std::string& procname,
+ const CommandLine& base_command_line,
+ const LaunchOptions& options) {
JNIEnv* env = android::AttachCurrentThread();
DCHECK(env);
@@ -52,9 +54,18 @@ Process SpawnMultiProcessTestChild(const std::string& procname,
android::ScopedJavaLocalRef<jobjectArray> j_argv =
android::ToJavaArrayOfStrings(env, command_line.argv());
- jint pid = android::Java_MultiprocessTestClientLauncher_launchClient(
- env, android::GetApplicationContext(), j_argv, fds);
- return Process(pid);
+ android::ScopedJavaLocalRef<jobject> launch_result =
+ android::Java_MultiprocessTestClientLauncher_launchClient(
+ env, android::GetApplicationContext(), j_argv, fds);
+
+ SpawnChildResult result;
+ result.process = Process(Java_LaunchClientResult_getPid(env, launch_result));
+ result.parcelable_channel_client.Reset(
+ Java_LaunchClientResult_getParcelableChannelClient(env, launch_result));
+ result.parcelable_channel_server.Reset(
+ Java_LaunchClientResult_getParcelableChannelServer(env, launch_result));
+
+ return result;
}
bool WaitForMultiprocessTestChildExit(const Process& process,
« no previous file with comments | « base/test/multiprocess_test.cc ('k') | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698