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

Side by Side Diff: chrome/browser/zygote_host_linux.cc

Issue 397031: Launch processes asynchronously so as not to block the UI thread. For now, re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: return 0 instead of -1 if zygote couldn't launch renderer Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/zygote_host_linux.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <sys/socket.h> 7 #include <sys/socket.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 pickle.WriteInt(mapping.size()); 193 pickle.WriteInt(mapping.size());
194 194
195 std::vector<int> fds; 195 std::vector<int> fds;
196 for (base::GlobalDescriptors::Mapping::const_iterator 196 for (base::GlobalDescriptors::Mapping::const_iterator
197 i = mapping.begin(); i != mapping.end(); ++i) { 197 i = mapping.begin(); i != mapping.end(); ++i) {
198 pickle.WriteUInt32(i->first); 198 pickle.WriteUInt32(i->first);
199 fds.push_back(i->second); 199 fds.push_back(i->second);
200 } 200 }
201 201
202 if (!base::SendMsg(control_fd_, pickle.data(), pickle.size(), fds)) 202 if (!base::SendMsg(control_fd_, pickle.data(), pickle.size(), fds))
203 return -1; 203 return base::kNullProcessHandle;
204 204
205 pid_t pid; 205 pid_t pid;
206 if (HANDLE_EINTR(read(control_fd_, &pid, sizeof(pid))) != sizeof(pid)) 206 if (HANDLE_EINTR(read(control_fd_, &pid, sizeof(pid))) != sizeof(pid))
207 return -1; 207 return base::kNullProcessHandle;
208 208
209 return pid; 209 return pid;
210 } 210 }
211 211
212 void ZygoteHost::EnsureProcessTerminated(pid_t process) { 212 void ZygoteHost::EnsureProcessTerminated(pid_t process) {
213 DCHECK(init_); 213 DCHECK(init_);
214 Pickle pickle; 214 Pickle pickle;
215 215
216 pickle.WriteInt(kCmdReap); 216 pickle.WriteInt(kCmdReap);
217 pickle.WriteInt(process); 217 pickle.WriteInt(process);
(...skipping 29 matching lines...) Expand all
247 !read_pickle.ReadBool(&iter, &tmp_child_exited)) { 247 !read_pickle.ReadBool(&iter, &tmp_child_exited)) {
248 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; 248 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote.";
249 return false; 249 return false;
250 } 250 }
251 251
252 if (child_exited) 252 if (child_exited)
253 *child_exited = tmp_child_exited; 253 *child_exited = tmp_child_exited;
254 254
255 return did_crash; 255 return did_crash;
256 } 256 }
OLDNEW
« no previous file with comments | « chrome/browser/zygote_host_linux.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698