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