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

Unified Diff: content/zygote/zygote_linux.cc

Issue 240673002: Simplify ZygoteForkDelegate API further (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/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;

Powered by Google App Engine
This is Rietveld 408576698