Chromium Code Reviews| Index: content/zygote/zygote_linux.cc |
| diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc |
| index 04e9d830dfab935674277455d7ad0a8519cc28eb..05f41c0123535007fbea2e49891830b5834b4a73 100644 |
| --- a/content/zygote/zygote_linux.cc |
| +++ b/content/zygote/zygote_linux.cc |
| @@ -333,7 +333,7 @@ int Zygote::ForkWithRealPid(const std::string& process_type, |
| fds.push_back(ipc_channel_fd); // kBrowserFDIndex |
| fds.push_back(dummy_fd); // kDummyFDIndex |
| fds.push_back(pipe_fds[0]); // kParentFDIndex |
| - pid = helper_->Fork(process_type, fds); |
| + pid = helper_->Fork(process_type, fds, channel_id); |
| } else { |
| pid = fork(); |
| } |
| @@ -410,18 +410,11 @@ int Zygote::ForkWithRealPid(const std::string& process_type, |
| process_info_map_[real_pid].internal_pid = pid; |
| process_info_map_[real_pid].started_from_helper = use_helper; |
| - if (use_helper) { |
| - if (!helper_->AckChild(pipe_fds[1], channel_id)) { |
| - LOG(ERROR) << "Failed to synchronise with zygote fork helper"; |
| - goto error; |
| - } |
| - } else { |
| - int written = |
| - HANDLE_EINTR(write(pipe_fds[1], &real_pid, sizeof(real_pid))); |
| - if (written != sizeof(real_pid)) { |
| - LOG(ERROR) << "Failed to synchronise with child process"; |
| - goto error; |
| - } |
| + ssize_t written = |
|
Mark Seaborn
2014/04/17 18:32:12
Maybe we could zero out real_pid if use_helper is
|
| + HANDLE_EINTR(write(pipe_fds[1], &real_pid, sizeof(real_pid))); |
| + if (written != sizeof(real_pid)) { |
| + LOG(ERROR) << "Failed to synchronise with child process"; |
| + goto error; |
| } |
| close(pipe_fds[1]); |
| return real_pid; |