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

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

Issue 695353005: Non-SFI mode: Use dummy PID for NaCl's IPC channel on Linux platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('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/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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 base::ProcessId real_pid; 388 base::ProcessId real_pid;
389 if (!base::ReadFromFD(read_pipe.get(), 389 if (!base::ReadFromFD(read_pipe.get(),
390 reinterpret_cast<char*>(&real_pid), 390 reinterpret_cast<char*>(&real_pid),
391 sizeof(real_pid))) { 391 sizeof(real_pid))) {
392 LOG(FATAL) << "Failed to synchronise with parent zygote process"; 392 LOG(FATAL) << "Failed to synchronise with parent zygote process";
393 } 393 }
394 if (real_pid <= 0) { 394 if (real_pid <= 0) {
395 LOG(FATAL) << "Invalid pid from parent zygote"; 395 LOG(FATAL) << "Invalid pid from parent zygote";
396 } 396 }
397 #if defined(OS_LINUX) 397 #if defined(OS_LINUX)
398 // Sandboxed processes need to send the global, non-namespaced PID when
399 // setting up an IPC channel to their parent.
400 IPC::Channel::SetGlobalPid(real_pid);
401 // Force the real PID so chrome event data have a PID that corresponds 398 // Force the real PID so chrome event data have a PID that corresponds
402 // to system trace event data. 399 // to system trace event data.
403 base::debug::TraceLog::GetInstance()->SetProcessID( 400 base::debug::TraceLog::GetInstance()->SetProcessID(
404 static_cast<int>(real_pid)); 401 static_cast<int>(real_pid));
405 #endif 402 #endif
406 return 0; 403 return 0;
407 } 404 }
408 405
409 // In the parent process. 406 // In the parent process.
410 read_pipe.reset(); 407 read_pipe.reset();
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 PickleIterator iter) { 582 PickleIterator iter) {
586 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != 583 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) !=
587 sizeof(sandbox_flags_)) { 584 sizeof(sandbox_flags_)) {
588 PLOG(ERROR) << "write"; 585 PLOG(ERROR) << "write";
589 } 586 }
590 587
591 return false; 588 return false;
592 } 589 }
593 590
594 } // namespace content 591 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698