| 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 "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 5 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 bool stdin_connected = ConnectNamedPipe(stdin_pipe.Get(), NULL) ? | 163 bool stdin_connected = ConnectNamedPipe(stdin_pipe.Get(), NULL) ? |
| 164 TRUE : GetLastError() == ERROR_PIPE_CONNECTED; | 164 TRUE : GetLastError() == ERROR_PIPE_CONNECTED; |
| 165 if (!stdout_connected || !stdin_connected) { | 165 if (!stdout_connected || !stdin_connected) { |
| 166 cmd_process.Terminate(0, false); | 166 cmd_process.Terminate(0, false); |
| 167 LOG(ERROR) << "Failed to connect IO pipes when starting " | 167 LOG(ERROR) << "Failed to connect IO pipes when starting " |
| 168 << command_line.GetProgram().MaybeAsASCII(); | 168 << command_line.GetProgram().MaybeAsASCII(); |
| 169 return false; | 169 return false; |
| 170 } | 170 } |
| 171 | 171 |
| 172 *process = cmd_process.Pass(); | 172 *process = cmd_process.Pass(); |
| 173 *read_file = base::File(stdout_pipe.Take()); | 173 *read_file = base::File::CreateForAsyncHandle(stdout_pipe.Take()); |
| 174 *write_file = base::File(stdin_pipe.Take()); | 174 *write_file = base::File::CreateForAsyncHandle(stdin_pipe.Take()); |
| 175 | 175 |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace extensions | 179 } // namespace extensions |
| OLD | NEW |