| 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 // Our socket from the browser. | 526 // Our socket from the browser. |
| 527 PCHECK(0 == IGNORE_EINTR(close(kZygoteSocketPairFd))); | 527 PCHECK(0 == IGNORE_EINTR(close(kZygoteSocketPairFd))); |
| 528 | 528 |
| 529 // Pass ownership of file descriptors from fds to GlobalDescriptors. | 529 // Pass ownership of file descriptors from fds to GlobalDescriptors. |
| 530 for (ScopedVector<base::ScopedFD>::iterator i = fds.begin(); i != fds.end(); | 530 for (ScopedVector<base::ScopedFD>::iterator i = fds.begin(); i != fds.end(); |
| 531 ++i) | 531 ++i) |
| 532 ignore_result((*i)->release()); | 532 ignore_result((*i)->release()); |
| 533 base::GlobalDescriptors::GetInstance()->Reset(mapping); | 533 base::GlobalDescriptors::GetInstance()->Reset(mapping); |
| 534 | 534 |
| 535 // Reset the process-wide command line to our new command line. | 535 // Reset the process-wide command line to our new command line. |
| 536 CommandLine::Reset(); | 536 base::CommandLine::Reset(); |
| 537 CommandLine::Init(0, NULL); | 537 base::CommandLine::Init(0, NULL); |
| 538 CommandLine::ForCurrentProcess()->InitFromArgv(args); | 538 base::CommandLine::ForCurrentProcess()->InitFromArgv(args); |
| 539 | 539 |
| 540 // Update the process title. The argv was already cached by the call to | 540 // Update the process title. The argv was already cached by the call to |
| 541 // SetProcessTitleFromCommandLine in ChromeMain, so we can pass NULL here | 541 // SetProcessTitleFromCommandLine in ChromeMain, so we can pass NULL here |
| 542 // (we don't have the original argv at this point). | 542 // (we don't have the original argv at this point). |
| 543 SetProcessTitleFromCommandLine(NULL); | 543 SetProcessTitleFromCommandLine(NULL); |
| 544 } else if (child_pid < 0) { | 544 } else if (child_pid < 0) { |
| 545 LOG(ERROR) << "Zygote could not fork: process_type " << process_type | 545 LOG(ERROR) << "Zygote could not fork: process_type " << process_type |
| 546 << " numfds " << numfds << " child_pid " << child_pid; | 546 << " numfds " << numfds << " child_pid " << child_pid; |
| 547 } | 547 } |
| 548 return child_pid; | 548 return child_pid; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 PickleIterator iter) { | 582 PickleIterator iter) { |
| 583 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != | 583 if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) != |
| 584 sizeof(sandbox_flags_)) { | 584 sizeof(sandbox_flags_)) { |
| 585 PLOG(ERROR) << "write"; | 585 PLOG(ERROR) << "write"; |
| 586 } | 586 } |
| 587 | 587 |
| 588 return false; | 588 return false; |
| 589 } | 589 } |
| 590 | 590 |
| 591 } // namespace content | 591 } // namespace content |
| OLD | NEW |