| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/zygote_host_linux.h" | 5 #include "content/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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 base::TerminationStatus ZygoteHost::GetTerminationStatus( | 328 base::TerminationStatus ZygoteHost::GetTerminationStatus( |
| 329 base::ProcessHandle handle, | 329 base::ProcessHandle handle, |
| 330 int* exit_code) { | 330 int* exit_code) { |
| 331 DCHECK(init_); | 331 DCHECK(init_); |
| 332 Pickle pickle; | 332 Pickle pickle; |
| 333 pickle.WriteInt(kCmdGetTerminationStatus); | 333 pickle.WriteInt(kCmdGetTerminationStatus); |
| 334 pickle.WriteInt(handle); | 334 pickle.WriteInt(handle); |
| 335 | 335 |
| 336 // Set this now to handle the early termination cases. | 336 // Set this now to handle the early termination cases. |
| 337 if (exit_code) | 337 if (exit_code) |
| 338 *exit_code = ResultCodes::NORMAL_EXIT; | 338 *exit_code = content::RESULT_CODE_NORMAL_EXIT; |
| 339 | 339 |
| 340 static const unsigned kMaxMessageLength = 128; | 340 static const unsigned kMaxMessageLength = 128; |
| 341 char buf[kMaxMessageLength]; | 341 char buf[kMaxMessageLength]; |
| 342 ssize_t len; | 342 ssize_t len; |
| 343 { | 343 { |
| 344 base::AutoLock lock(control_lock_); | 344 base::AutoLock lock(control_lock_); |
| 345 if (HANDLE_EINTR(write(control_fd_, pickle.data(), pickle.size())) < 0) | 345 if (HANDLE_EINTR(write(control_fd_, pickle.data(), pickle.size())) < 0) |
| 346 PLOG(ERROR) << "write"; | 346 PLOG(ERROR) << "write"; |
| 347 | 347 |
| 348 len = ReadReply(buf, sizeof(buf)); | 348 len = ReadReply(buf, sizeof(buf)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 363 !read_pickle.ReadInt(&iter, &tmp_exit_code)) { | 363 !read_pickle.ReadInt(&iter, &tmp_exit_code)) { |
| 364 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; | 364 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; |
| 365 return base::TERMINATION_STATUS_NORMAL_TERMINATION; | 365 return base::TERMINATION_STATUS_NORMAL_TERMINATION; |
| 366 } | 366 } |
| 367 | 367 |
| 368 if (exit_code) | 368 if (exit_code) |
| 369 *exit_code = tmp_exit_code; | 369 *exit_code = tmp_exit_code; |
| 370 | 370 |
| 371 return static_cast<base::TerminationStatus>(status); | 371 return static_cast<base::TerminationStatus>(status); |
| 372 } | 372 } |
| OLD | NEW |