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

Side by Side Diff: content/browser/zygote_host/zygote_host_impl_linux.cc

Issue 11316261: Linux: inform the Zygote when it's waiting on a dead process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Adam's remarks. Created 8 years 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 | « content/browser/zygote_host/zygote_host_impl_linux.h ('k') | content/zygote/zygote_linux.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/zygote_host_impl_linux.h" 5 #include "content/browser/zygote_host/zygote_host_impl_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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 Pickle pickle; 444 Pickle pickle;
445 445
446 pickle.WriteInt(kZygoteCommandReap); 446 pickle.WriteInt(kZygoteCommandReap);
447 pickle.WriteInt(process); 447 pickle.WriteInt(process);
448 if (!SendMessage(pickle, NULL)) 448 if (!SendMessage(pickle, NULL))
449 LOG(ERROR) << "Failed to send Reap message to zygote"; 449 LOG(ERROR) << "Failed to send Reap message to zygote";
450 } 450 }
451 451
452 base::TerminationStatus ZygoteHostImpl::GetTerminationStatus( 452 base::TerminationStatus ZygoteHostImpl::GetTerminationStatus(
453 base::ProcessHandle handle, 453 base::ProcessHandle handle,
454 bool known_dead,
454 int* exit_code) { 455 int* exit_code) {
455 DCHECK(init_); 456 DCHECK(init_);
456 Pickle pickle; 457 Pickle pickle;
457 pickle.WriteInt(kZygoteCommandGetTerminationStatus); 458 pickle.WriteInt(kZygoteCommandGetTerminationStatus);
459 pickle.WriteBool(known_dead);
458 pickle.WriteInt(handle); 460 pickle.WriteInt(handle);
459 461
460 // Set this now to handle the early termination cases. 462 // Set this now to handle the early termination cases.
461 if (exit_code) 463 if (exit_code)
462 *exit_code = RESULT_CODE_NORMAL_EXIT; 464 *exit_code = RESULT_CODE_NORMAL_EXIT;
463 465
464 static const unsigned kMaxMessageLength = 128; 466 static const unsigned kMaxMessageLength = 128;
465 char buf[kMaxMessageLength]; 467 char buf[kMaxMessageLength];
466 ssize_t len; 468 ssize_t len;
467 { 469 {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 return RenderSandboxHostLinux::GetInstance()->pid(); 504 return RenderSandboxHostLinux::GetInstance()->pid();
503 } 505 }
504 506
505 int ZygoteHostImpl::GetSandboxStatus() const { 507 int ZygoteHostImpl::GetSandboxStatus() const {
506 if (have_read_sandbox_status_word_) 508 if (have_read_sandbox_status_word_)
507 return sandbox_status_; 509 return sandbox_status_;
508 return 0; 510 return 0;
509 } 511 }
510 512
511 } // namespace content 513 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/zygote_host/zygote_host_impl_linux.h ('k') | content/zygote/zygote_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698