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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // preserve these three FDs in forked processes, so kRelauncherSyncFD should | 146 // preserve these three FDs in forked processes, so kRelauncherSyncFD should |
147 // not conflict with them. | 147 // not conflict with them. |
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 if (!base::LaunchApp(relaunch_args, fd_map, false, NULL)) { | 156 base::LaunchOptions options; |
157 LOG(ERROR) << "base::LaunchApp failed"; | 157 options.fds_to_remap = &fd_map; |
| 158 if (!base::LaunchProcess(relaunch_args, options)) { |
| 159 LOG(ERROR) << "base::LaunchProcess failed"; |
158 return false; | 160 return false; |
159 } | 161 } |
160 | 162 |
161 // 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 |
162 // original parent process continues. | 164 // original parent process continues. |
163 | 165 |
164 pipe_write_fd.reset(); // close(pipe_fds[1]); | 166 pipe_write_fd.reset(); // close(pipe_fds[1]); |
165 | 167 |
166 // Synchronize with the relauncher process. | 168 // Synchronize with the relauncher process. |
167 char read_char; | 169 char read_char; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if (!dmg_bsd_device_name.empty()) { | 381 if (!dmg_bsd_device_name.empty()) { |
380 EjectAndTrashDiskImage(dmg_bsd_device_name); | 382 EjectAndTrashDiskImage(dmg_bsd_device_name); |
381 } | 383 } |
382 | 384 |
383 return 0; | 385 return 0; |
384 } | 386 } |
385 | 387 |
386 } // namespace internal | 388 } // namespace internal |
387 | 389 |
388 } // namespace mac_relauncher | 390 } // namespace mac_relauncher |
OLD | NEW |