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

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

Issue 11819021: NaCl: Clean up file descriptor setup in nacl_helper on linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove kNaClBrowserDescriptor Created 7 years, 11 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 | Annotate | Revision Log
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 <dlfcn.h> 5 #include <dlfcn.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // There need to be a corresponding call to PreinitializeSandboxFinish() 456 // There need to be a corresponding call to PreinitializeSandboxFinish()
457 // for each new process, this will be done in the Zygote child, once we know 457 // for each new process, this will be done in the Zygote child, once we know
458 // our process type. 458 // our process type.
459 linux_sandbox->PreinitializeSandboxBegin(); 459 linux_sandbox->PreinitializeSandboxBegin();
460 460
461 sandbox::SetuidSandboxClient* setuid_sandbox = 461 sandbox::SetuidSandboxClient* setuid_sandbox =
462 linux_sandbox->setuid_sandbox_client(); 462 linux_sandbox->setuid_sandbox_client();
463 463
464 if (forkdelegate != NULL) { 464 if (forkdelegate != NULL) {
465 VLOG(1) << "ZygoteMain: initializing fork delegate"; 465 VLOG(1) << "ZygoteMain: initializing fork delegate";
466 forkdelegate->Init(Zygote::kBrowserDescriptor, 466 forkdelegate->Init(Zygote::kMagicSandboxIPCDescriptor);
467 Zygote::kMagicSandboxIPCDescriptor);
468 } else { 467 } else {
469 VLOG(1) << "ZygoteMain: fork delegate is NULL"; 468 VLOG(1) << "ZygoteMain: fork delegate is NULL";
470 } 469 }
471 470
472 // Turn on the SELinux or SUID sandbox. 471 // Turn on the SELinux or SUID sandbox.
473 bool using_suid_sandbox = false; 472 bool using_suid_sandbox = false;
474 bool has_started_new_init = false; 473 bool has_started_new_init = false;
475 474
476 if (!EnterSandbox(setuid_sandbox, 475 if (!EnterSandbox(setuid_sandbox,
477 &using_suid_sandbox, 476 &using_suid_sandbox,
(...skipping 10 matching lines...) Expand all
488 } 487 }
489 488
490 int sandbox_flags = linux_sandbox->GetStatus(); 489 int sandbox_flags = linux_sandbox->GetStatus();
491 490
492 Zygote zygote(sandbox_flags, forkdelegate); 491 Zygote zygote(sandbox_flags, forkdelegate);
493 // This function call can return multiple times, once per fork(). 492 // This function call can return multiple times, once per fork().
494 return zygote.ProcessRequests(); 493 return zygote.ProcessRequests();
495 } 494 }
496 495
497 } // namespace content 496 } // namespace content
OLDNEW
« chrome/common/nacl_helper_linux.h ('K') | « content/public/common/zygote_fork_delegate_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698