OLD | NEW |
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 395 } |
396 if (real_pid <= 0) { | 396 if (real_pid <= 0) { |
397 LOG(FATAL) << "Invalid pid from parent zygote"; | 397 LOG(FATAL) << "Invalid pid from parent zygote"; |
398 } | 398 } |
399 #if defined(OS_LINUX) | 399 #if defined(OS_LINUX) |
400 // Sandboxed processes need to send the global, non-namespaced PID when | 400 // Sandboxed processes need to send the global, non-namespaced PID when |
401 // setting up an IPC channel to their parent. | 401 // setting up an IPC channel to their parent. |
402 IPC::Channel::SetGlobalPid(real_pid); | 402 IPC::Channel::SetGlobalPid(real_pid); |
403 // Force the real PID so chrome event data have a PID that corresponds | 403 // Force the real PID so chrome event data have a PID that corresponds |
404 // to system trace event data. | 404 // to system trace event data. |
405 base::debug::TraceLog::GetInstance()->SetProcessID( | 405 base::trace_event::TraceLog::GetInstance()->SetProcessID( |
406 static_cast<int>(real_pid)); | 406 static_cast<int>(real_pid)); |
407 #endif | 407 #endif |
408 return 0; | 408 return 0; |
409 } | 409 } |
410 | 410 |
411 // In the parent process. | 411 // In the parent process. |
412 read_pipe.reset(); | 412 read_pipe.reset(); |
413 pid_oracle.reset(); | 413 pid_oracle.reset(); |
414 | 414 |
415 // Always receive a real PID from the zygote host, though it might | 415 // Always receive a real PID from the zygote host, though it might |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 PickleIterator iter) { | 584 PickleIterator iter) { |
585 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != | 585 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != |
586 sizeof(sandbox_flags_)) { | 586 sizeof(sandbox_flags_)) { |
587 PLOG(ERROR) << "write"; | 587 PLOG(ERROR) << "write"; |
588 } | 588 } |
589 | 589 |
590 return false; | 590 return false; |
591 } | 591 } |
592 | 592 |
593 } // namespace content | 593 } // namespace content |
OLD | NEW |