| Index: content/browser/child_process_launcher_helper_android.cc
|
| diff --git a/content/browser/child_process_launcher_helper_android.cc b/content/browser/child_process_launcher_helper_android.cc
|
| index fafbc5d54a1bde0c2eea81f1a9f17ab75225911a..b498bb4f522b5c2e33d51f80e57f728f7dccac1d 100644
|
| --- a/content/browser/child_process_launcher_helper_android.cc
|
| +++ b/content/browser/child_process_launcher_helper_android.cc
|
| @@ -199,14 +199,14 @@
|
| return base::File(base::android::OpenApkAsset(path.value(), region));
|
| }
|
|
|
| -// Called from ChildProcessLauncher.java when the ChildProcess was started.
|
| +// Called from ChildProcessLauncher.java when the ChildProcess was
|
| +// started.
|
| // |handle| is the processID of the child process as originated in Java, 0 if
|
| // the ChildProcess could not be created.
|
| void ChildProcessLauncherHelper::OnChildProcessStarted(
|
| JNIEnv*,
|
| const base::android::JavaParamRef<jobject>& obj,
|
| jint handle) {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
|
| scoped_refptr<ChildProcessLauncherHelper> ref(this);
|
| Release(); // Balances with LaunchProcessOnLauncherThread.
|
|
|
| @@ -214,9 +214,28 @@
|
| ? LAUNCH_RESULT_FAILURE
|
| : LAUNCH_RESULT_SUCCESS;
|
|
|
| + // TODO(jcivelli): Remove this by defining better what happens on what thread
|
| + // in the corresponding Java code.
|
| ChildProcessLauncherHelper::Process process;
|
| process.process = base::Process(handle);
|
| - PostLaunchOnLauncherThread(std::move(process), launch_result);
|
| + if (BrowserThread::CurrentlyOn(BrowserThread::PROCESS_LAUNCHER)) {
|
| + PostLaunchOnLauncherThread(std::move(process), launch_result,
|
| + false); // post_launch_on_client_thread_called
|
| + return;
|
| + }
|
| +
|
| + bool on_client_thread = BrowserThread::CurrentlyOn(
|
| + static_cast<BrowserThread::ID>(client_thread_id()));
|
| + BrowserThread::PostTask(
|
| + BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
|
| + base::Bind(&ChildProcessLauncherHelper::PostLaunchOnLauncherThread, this,
|
| + base::Passed(std::move(process)), launch_result,
|
| + on_client_thread));
|
| + if (on_client_thread) {
|
| + ChildProcessLauncherHelper::Process process;
|
| + process.process = base::Process(handle);
|
| + PostLaunchOnClientThread(std::move(process), launch_result);
|
| + }
|
| }
|
|
|
| // static
|
|
|