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

Side by Side Diff: content/zygote/zygote_linux.cc

Issue 1186873006: Add Get/SetUniqueIdForProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 5 years, 6 months 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
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/zygote/zygote_linux.h" 5 #include "content/zygote/zygote_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 LOG(FATAL) << "Invalid pid from parent zygote"; 433 LOG(FATAL) << "Invalid pid from parent zygote";
434 } 434 }
435 #if defined(OS_LINUX) 435 #if defined(OS_LINUX)
436 // Sandboxed processes need to send the global, non-namespaced PID when 436 // Sandboxed processes need to send the global, non-namespaced PID when
437 // setting up an IPC channel to their parent. 437 // setting up an IPC channel to their parent.
438 IPC::Channel::SetGlobalPid(real_pid); 438 IPC::Channel::SetGlobalPid(real_pid);
439 // Force the real PID so chrome event data have a PID that corresponds 439 // Force the real PID so chrome event data have a PID that corresponds
440 // to system trace event data. 440 // to system trace event data.
441 base::trace_event::TraceLog::GetInstance()->SetProcessID( 441 base::trace_event::TraceLog::GetInstance()->SetProcessID(
442 static_cast<int>(real_pid)); 442 static_cast<int>(real_pid));
443 base::SetUniqueIdForProcess(static_cast<uint32>(real_pid));
443 #endif 444 #endif
444 return 0; 445 return 0;
445 } 446 }
446 447
447 // In the parent process. 448 // In the parent process.
448 read_pipe.reset(); 449 read_pipe.reset();
449 pid_oracle.reset(); 450 pid_oracle.reset();
450 451
451 // Always receive a real PID from the zygote host, though it might 452 // Always receive a real PID from the zygote host, though it might
452 // be invalid (see below). 453 // be invalid (see below).
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 bool Zygote::HandleGetSandboxStatus(int fd, base::PickleIterator iter) { 620 bool Zygote::HandleGetSandboxStatus(int fd, base::PickleIterator iter) {
620 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != 621 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) !=
621 sizeof(sandbox_flags_)) { 622 sizeof(sandbox_flags_)) {
622 PLOG(ERROR) << "write"; 623 PLOG(ERROR) << "write";
623 } 624 }
624 625
625 return false; 626 return false;
626 } 627 }
627 628
628 } // namespace content 629 } // namespace content
OLDNEW
« base/process/process_handle.cc ('K') | « base/process/process_handle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698