OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/zygote_host_linux.h" | 5 #include "chrome/browser/zygote_host_linux.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Start up the sandbox host process and get the file descriptor for the | 115 // Start up the sandbox host process and get the file descriptor for the |
116 // renderers to talk to it. | 116 // renderers to talk to it. |
117 const int sfd = Singleton<RenderSandboxHostLinux>()->GetRendererSocket(); | 117 const int sfd = Singleton<RenderSandboxHostLinux>()->GetRendererSocket(); |
118 fds_to_map.push_back(std::make_pair(sfd, 5)); | 118 fds_to_map.push_back(std::make_pair(sfd, 5)); |
119 | 119 |
120 base::ProcessHandle process; | 120 base::ProcessHandle process; |
121 base::LaunchApp(cmd_line.argv(), fds_to_map, false, &process); | 121 base::LaunchApp(cmd_line.argv(), fds_to_map, false, &process); |
122 CHECK(process != -1) << "Failed to launch zygote process"; | 122 CHECK(process != -1) << "Failed to launch zygote process"; |
123 | 123 |
| 124 pid_ = process; |
124 close(fds[1]); | 125 close(fds[1]); |
125 control_fd_ = fds[0]; | 126 control_fd_ = fds[0]; |
126 } | 127 } |
127 | 128 |
128 ZygoteHost::~ZygoteHost() { | 129 ZygoteHost::~ZygoteHost() { |
129 close(control_fd_); | 130 close(control_fd_); |
130 } | 131 } |
131 | 132 |
132 pid_t ZygoteHost::ForkRenderer( | 133 pid_t ZygoteHost::ForkRenderer( |
133 const std::vector<std::string>& argv, | 134 const std::vector<std::string>& argv, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 !read_pickle.ReadBool(&iter, &tmp_child_exited)) { | 196 !read_pickle.ReadBool(&iter, &tmp_child_exited)) { |
196 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; | 197 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; |
197 return false; | 198 return false; |
198 } | 199 } |
199 | 200 |
200 if (child_exited) | 201 if (child_exited) |
201 *child_exited = tmp_child_exited; | 202 *child_exited = tmp_child_exited; |
202 | 203 |
203 return did_crash; | 204 return did_crash; |
204 } | 205 } |
OLD | NEW |