| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 // Command-line buffer cannot be constant, per CreateProcess signature. | 197 // Command-line buffer cannot be constant, per CreateProcess signature. |
| 198 handles_for_parent->process = LaunchCommandLine(&command_line[0]); | 198 handles_for_parent->process = LaunchCommandLine(&command_line[0]); |
| 199 if (!handles_for_parent->process.is_valid()) | 199 if (!handles_for_parent->process.is_valid()) |
| 200 return std::unique_ptr<Handles>(); | 200 return std::unique_ptr<Handles>(); |
| 201 | 201 |
| 202 // Block until the child process has launched. CreateProcess() returns | 202 // Block until the child process has launched. CreateProcess() returns |
| 203 // immediately, and test code expects process initialization to have | 203 // immediately, and test code expects process initialization to have |
| 204 // completed so it can, for example, read the process memory. | 204 // completed so it can, for example, read the process memory. |
| 205 char c; | 205 char c; |
| 206 if (!LoggingReadFile(handles_for_parent->read.get(), &c, sizeof(c))) { | 206 if (!LoggingReadFileExactly(handles_for_parent->read.get(), &c, sizeof(c))) { |
| 207 ADD_FAILURE() << "LoggedReadFile"; | 207 ADD_FAILURE() << "LoggedReadFile"; |
| 208 return std::unique_ptr<Handles>(); | 208 return std::unique_ptr<Handles>(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (c != ' ') { | 211 if (c != ' ') { |
| 212 ADD_FAILURE() << "invalid data read from child"; | 212 ADD_FAILURE() << "invalid data read from child"; |
| 213 return std::unique_ptr<Handles>(); | 213 return std::unique_ptr<Handles>(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 return std::move(handles_for_parent); | 216 return std::move(handles_for_parent); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 227 void WinChildProcess::CloseReadPipe() { | 227 void WinChildProcess::CloseReadPipe() { |
| 228 pipe_read_.reset(); | 228 pipe_read_.reset(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void WinChildProcess::CloseWritePipe() { | 231 void WinChildProcess::CloseWritePipe() { |
| 232 pipe_write_.reset(); | 232 pipe_write_.reset(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace test | 235 } // namespace test |
| 236 } // namespace crashpad | 236 } // namespace crashpad |
| OLD | NEW |