| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/mac/relauncher.h" | 5 #include "chrome/browser/mac/relauncher.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #include <AvailabilityMacros.h> | 8 #include <AvailabilityMacros.h> |
| 9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 COMPILE_ASSERT(kRelauncherSyncFD != STDIN_FILENO && | 148 COMPILE_ASSERT(kRelauncherSyncFD != STDIN_FILENO && |
| 149 kRelauncherSyncFD != STDOUT_FILENO && | 149 kRelauncherSyncFD != STDOUT_FILENO && |
| 150 kRelauncherSyncFD != STDERR_FILENO, | 150 kRelauncherSyncFD != STDERR_FILENO, |
| 151 kRelauncherSyncFD_must_not_conflict_with_stdio_fds); | 151 kRelauncherSyncFD_must_not_conflict_with_stdio_fds); |
| 152 | 152 |
| 153 base::file_handle_mapping_vector fd_map; | 153 base::file_handle_mapping_vector fd_map; |
| 154 fd_map.push_back(std::make_pair(*pipe_write_fd, kRelauncherSyncFD)); | 154 fd_map.push_back(std::make_pair(*pipe_write_fd, kRelauncherSyncFD)); |
| 155 | 155 |
| 156 base::LaunchOptions options; | 156 base::LaunchOptions options; |
| 157 options.fds_to_remap = &fd_map; | 157 options.fds_to_remap = &fd_map; |
| 158 if (!base::LaunchProcess(relaunch_args, options)) { | 158 if (!base::LaunchProcess(relaunch_args, options, NULL)) { |
| 159 LOG(ERROR) << "base::LaunchProcess failed"; | 159 LOG(ERROR) << "base::LaunchProcess failed"; |
| 160 return false; | 160 return false; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // The relauncher process is now starting up, or has started up. The | 163 // The relauncher process is now starting up, or has started up. The |
| 164 // original parent process continues. | 164 // original parent process continues. |
| 165 | 165 |
| 166 pipe_write_fd.reset(); // close(pipe_fds[1]); | 166 pipe_write_fd.reset(); // close(pipe_fds[1]); |
| 167 | 167 |
| 168 // Synchronize with the relauncher process. | 168 // Synchronize with the relauncher process. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (!dmg_bsd_device_name.empty()) { | 381 if (!dmg_bsd_device_name.empty()) { |
| 382 EjectAndTrashDiskImage(dmg_bsd_device_name); | 382 EjectAndTrashDiskImage(dmg_bsd_device_name); |
| 383 } | 383 } |
| 384 | 384 |
| 385 return 0; | 385 return 0; |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace internal | 388 } // namespace internal |
| 389 | 389 |
| 390 } // namespace mac_relauncher | 390 } // namespace mac_relauncher |
| OLD | NEW |